Skip to content

Gradle Plugin Doesn't Generate Federation Directives #2242

@kartomic8

Description

@kartomic8

When using the Gradle Plugin (v2.6.2), the output of the generateSchema gradle task does not appear to generate federation-compatible directives.

Sample code:

generateSchema {
    destination = "build/generated/schema.graphql"
    includeTransitiveDependencies = true
    includeDirectives = true
    includeScalars = true
}
// Example of annotated class
@Data
@AllArgsConstructor
@Shareable
public class Menu {
  @NonNull List<MenuItem> menuItems;
}
# generated graphql
# expected @shareable directive in the line below, but it is not there:

type Menu {
  menuItems: [MenuItem]!
}


# In addition, the federation directives aren't imported, nor are they defined in the output.

I took a look at the maven plugin, which does appear to implement federation, and I can't find similar code in the gradle plugin, so I believe its just not implemented. Can the team confirm, and if it isn't implemented advise on a timeframe for doing so?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions