Reputation: 727
Let's say I create a new RedwoodJS project from scratch with
yarn create redwood-app my-project
In this step, I've chosen to create a Typescript project... Then I setup this project to use both the experimental server and realtime features:
yarn rw exp setup-server-file
yarn rw exp setup-realtime
And finally, I create a new subscription:
yarn rw exp generate-realtime mySub
So far it seems to be working fine and I get the following result:
However, if I now start this project with yarn rw dev
and go to the graphiql endpoint on http://localhost:8911/graphql
, the suggested subscription query on my code doesn't work, if I try to run
subscription ListenToMysubChannel {
listenToMysubChannel(id: "1") {
body
from
}
}
I get the error:
{
"errors": [
{
"message": "GraphQL operation type \"subscription\" is not allowed.",
"locations": [
{
"line": 1,
"column": 1
}
]
}
]
}
What am I missing in this procedure? Do I need to manually edit any file in order to activate the GraphQL subscriptions?
Upvotes: 0
Views: 100
Reputation: 1
Bit of a stab but maybe you've missed this step: https://redwoodjs.com/docs/realtime#graphql-configuration
Specifically: uncommenting the 'realtime' at the end of api/server.ts.
Upvotes: 0