Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.

Graphql variables in nested types #5

Open
szomolanyi opened this issue Jul 6, 2018 · 2 comments
Open

Graphql variables in nested types #5

szomolanyi opened this issue Jul 6, 2018 · 2 comments

Comments

@szomolanyi
Copy link

Got error while playing with graphql API in worldcup branch.

Error :
{
  "data": {
    "worldcups": null
  },
  "errors": [
    {
      "message": "Cannot read property 'replace' of undefined",
      "locations": [],
      "path": [
        "worldcups"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "errors": [
            {
              "message": "Cannot read property 'replace' of undefined",
              "locations": [],
              "path": [
                "worldcups"
              ]
            }
          ],
          "stacktrace": [
            "Error: Cannot read property 'replace' of undefined",
            "    at new CombinedError (/home/nowuser/src/node_modules/graphql-tools/src/stitching/errors.ts:85:5)",
            "    at Object.checkResultAndHandleErrors (/home/nowuser/src/node_modules/graphql-tools/src/stitching/errors.ts:107:11)",
            "    at CheckResultAndHandleErrors.transformResult (/home/nowuser/src/node_modules/graphql-tools/src/transforms/CheckResultAndHandleErrors.ts:15:12)",
            "    at /home/nowuser/src/node_modules/graphql-tools/src/transforms/transforms.ts:37:45",
            "    at Array.reduce (<anonymous>)",
            "    at applyResultTransforms (/home/nowuser/src/node_modules/graphql-tools/src/transforms/transforms.ts:35:21)",
            "    at /home/nowuser/src/node_modules/graphql-tools/src/stitching/delegateToSchema.ts:81:12",
            "    at step (/home/nowuser/src/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:32:23)",
            "    at Object.next (/home/nowuser/src/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:13:53)",
            "    at fulfilled (/home/nowuser/src/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:4:58)"
          ]
        }
      }
    }
  ]
}

while running following query :

query Matches($year: Int!, $round: String) {
  worldcups(year: $year) {
    name 
    matches(round: $round) {
      round
      description
      homeScore
      awayScore
    }
  }
}

with variables :

{
  "year": 2018,
  "round": "Group matches - Group C"
}
@jexp
Copy link
Collaborator

jexp commented Jul 6, 2018

Does it work with literals?

@szomolanyi
Copy link
Author

szomolanyi commented Jul 6, 2018

Yes, query with literals works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants