-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compose schema that's been through buildSubgraphSchema + printSubgraphSchema #1824
Comments
Thank you @benweatherman for adding issue about this! 🎉 I were planning to report this also here, but had not yet collected information what exactly is the issue. One thing that I noticed when not outputting Couple options came to my mind:
One option would be to define options to pick behaviour, but if that is not option I would prefer option 1. Thanks again for looking into this 🙌 😄 |
Thanks for all that info and appreciate the thoughtful consideration of those options. We plan on implementing the first option you suggested (don't output |
Awesome. Yes. That sounds perfect |
I've push fixes for this on #1831. But I'll note that imo the higher level issue here is that the output of And to clarify what I mean by "kind of a mess", as can be seen in the description, the output adds a bunch of definitions (directives and types) that aren't even used, but it's not a full schema either because the directives that are used ( So the attached PR makes it so that const typeDefs = gql`
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"])
type Greeting @key(fields: "name") {
message: String! @shareable
name: String!
}
type Query {
hello(name: String!): Greeting!
}
`; then |
The following script generates the supergraph schema and errors mentioned below. I'd expect this to compose without errors.
Output of
buildSubgraphSchema
+printSubgraphSchema
Slightly modified for brevity
Errors
Acceptance criteria
printSubgraphSchema
should output something very similar to the input schemaprintSubgraphSchema
is deprecated (this could be a new ticket)Implementation notes
Schema.from(schema: GraphQLJSSchema)
printSubgraphSchema
should utilize the above function to outputSchema.from(schema).toString()
buildSchema
(this would fix the enum errors)_Entities
,_entities
,_Service
, or_service
by defaultReported via apollographql/rover#1115
The text was updated successfully, but these errors were encountered: