-
Notifications
You must be signed in to change notification settings - Fork 173
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
Unused type definitions are not visible in introspection queries #420
Comments
I don't believe the schema introspection should be returning unused types. Can you find specs or some other projects that do return unused types? |
My use case to include unused types is for federation: class QueryResolver : GraphQLQueryResolver {}
val schema = """
type User @key(fields: "uuid") @extends {
uuid: ID! @external
hasCompletedKyc: Boolean!
}
type Query {}
"""
var schema = SchemaParser.newParser()
.schemaString(schema)
.resolvers(QueryResolver())
.build()
.makeExecutableSchema()
schema = Federation.transform(schema)
.resolveEntityType(...)
.fetchEntities(...) // this will resolve the external User type we're extending
.build()
println(SchemaPrinter().print(schema)) |
2 tasks
@vojtapol @oliemansm could we get some eyes on these PRs? 🙂 - federation compatibility is critical in my company's framework evaluation, the library looks great - would be great to see this feature working |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If we define a type that is unused in the schema file e.g
Query
andUser
types are returned from introspection queries but notContext
. Is this by design?SchemaParser.getUnusedDefinitions()
but is there a way to wire that in so that they are visible in introspection queries?The text was updated successfully, but these errors were encountered: