Integration with rmosolgo/graphql-streaming
See original GitHub issueHi, I’m trying to integrate this subscriptions module with ruby’s graphql-streaming. Getting that error:
Uncaught Error: RelayQuery: Expected operation `currentUserNotifications` to be annotated with the type of its argument. Either the babel transform was configured incorrectly, or the schema failed to define an argument for this mutation.
compiled schema object looks like this:
{
"kind": "OBJECT",
"name": "FrontAppSubscription",
"description": "The subscription root for main App Frontend",
"fields": [
{
"name": "currentUserNotifications",
"description": "The subscription root for main App Frontend",
"args": [
{
"name": "input",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "node",
"description": "Fetches an object given its ID.",
"args": [
{
"name": "id",
"description": "ID of the object.",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "INTERFACE",
"name": "Node",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
and the subscription itself is:
import Relay from 'react-relay';
import { Subscription } from 'relay-subscriptions';
import Notifications from './../app/components/Notifications/notifications';
export default class NotificationsSubscription extends Subscription {
static fragments = {
main: () => Relay.QL`
fragment on FrontApp {
currentUser {
uid
}
}
`,
};
getSubscription() {
return Relay.QL`
subscription {
currentUserNotifications(input: $input) {
${Notifications.getFragment('main')}
}
}
`;
}
getConfigs() {
return [{
type: 'FIELDS_CHANGE',
fieldIDs: {
user: this.props.main.currentUser.id,
},
}];
}
getVariables() {
return {
id: this.props.main.currentUser.id,
};
}
}
Is it possible to solve this error on frontend part? I tried supplying input type to subscription like that:
subscription($input_0: String!) {
currentUserNotifications(input: $input_0) {
${Notifications.getFragment('main')}
}
}
doesn’t work too, get same error.
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@edvinerikson yes, thanks for a great lib!
Thanks for helping out @taion! @valerybugakov do you feel that the issue has been resolved?