Handle graphql subscription type
Closed this issue · 1 comments
Hi,
I have a subscription type into my .gql
file but I don't know how to display it properly in the generate documentation. I've tried many option but it seems to think that Subscription is an operation but it's not.
type Mutation {
CreateSubscription(payload: CreateSubscriptionPayload!): Subscription
}
type Subscription {
id: Int!
name: String!
}
There is any solutions to handle this ? Thanks for your help
Hi @haflit21
It looks as if you're trying to give a custom type of yours the name Subscription
, yes? If that's the case, then this is not possible as Subscription
is a reserved type
name (just like type Query
and type Mutation
are). There is an operation in GraphQL for supporting subscribing to events/updates, and it's done via a reserved type Subscription
in the Schema. So your naming choice will have to be something other than Subscription
(or any other reserved type name) here, unfortunately.
This is not a SpectaQL issue, it's simply a thing with GraphQL and the spec. Closing for now, but if I am mistaken on your intention, please re-open and let me know.