Hello.
I am currently try to modify the schema generated from a SDL programatically by adding addition types, directives and so on. Without going too much into detail, I am able to get a reference to the generated schema (GraphQLSchema). Adding directives and types is no problem. However, I want to add also some additional queries to the Query type. I tried the following, but it fails with an exception:
val schema = bean.schema
val extendedQuery = schema.queryType.transform {
it.field(... adding a field ...)
}
val extendedSchema = schema.transform {
it.query(extendedQuery)
}
Caused by: graphql.AssertException: All types within a GraphQL schema must have unique names. No two provided types may have the same name. No provided type may have a name which conflicts with any built in types (including Scalar and Introspection types). You have redefined the type 'Query' from being a 'GraphQLObjectType' to a 'GraphQLObjectType'
Any ideas how I can add additional queries to my schema programmatically?
Thanks a lot.
Cheers,
Tobias
Hello.
I am currently try to modify the schema generated from a SDL programatically by adding addition types, directives and so on. Without going too much into detail, I am able to get a reference to the generated schema (GraphQLSchema). Adding directives and types is no problem. However, I want to add also some additional queries to the Query type. I tried the following, but it fails with an exception:
Caused by: graphql.AssertException: All types within a GraphQL schema must have unique names. No two provided types may have the same name. No provided type may have a name which conflicts with any built in types (including Scalar and Introspection types). You have redefined the type 'Query' from being a 'GraphQLObjectType' to a 'GraphQLObjectType'Any ideas how I can add additional queries to my schema programmatically?
Thanks a lot.
Cheers,
Tobias