question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integration with rmosolgo/graphql-streaming

See original GitHub issue

Hi, 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:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
valerybugakovcommented, Feb 27, 2017

@edvinerikson yes, thanks for a great lib!

0reactions
edvineriksoncommented, Feb 27, 2017

Thanks for helping out @taion! @valerybugakov do you feel that the issue has been resolved?

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found