You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an existing GraphQLSchema instance with no SubscriptionTypes and want to extend this schema with a new SubscriptionType. To extend we use the extendSchema utility. After extending the schema, the SubscriptionType is null on the new schema.
consttodoType=newGraphQLObjectType({name: 'Todo',description: 'A task to be completed',fields: {id: {type: GraphQLID},description: {type: GraphQLString},completed: {type: GraphQLBoolean},},});constqueryType=newGraphQLObjectType({name: 'QueryType',fields: {todo: {type: todoType,args: {id: {type: GraphQLID},},},},});// GraphQLSchema with no SubscriptionTypesconstschema=newGraphQLSchema({query: queryType});constextension=`type Subscription { todoCompleted: Todo }`;constextendedSchema=extendSchema(schema,parse(extension));assert.ok(!!extendedSchema.getSubscriptionType());// fails, extendedSchema.getSubscriptionType() is null
The text was updated successfully, but these errors were encountered:
Currently, extendSchema only extends existing types and does not add new root types to the schema - however this is certainly something to be investigated
We have an existing GraphQLSchema instance with no SubscriptionTypes and want to extend this schema with a new SubscriptionType. To extend we use the extendSchema utility. After extending the schema, the SubscriptionType is null on the new schema.
The text was updated successfully, but these errors were encountered: