Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

range: [] doesn't seem to work with variables in graphiQL #22

Closed
Trellian opened this issue Nov 10, 2017 · 2 comments
Closed

range: [] doesn't seem to work with variables in graphiQL #22

Trellian opened this issue Nov 10, 2017 · 2 comments
Labels

Comments

@Trellian
Copy link

I'm trying to test a query in the GraphiQL client, but it doesn't recognize variables in the query. They are simply ignored. The OrderBy: works fine.

The query:

query getRegions ($start: Int, $end: Int) {
  iwRegions (range: [$start, $end], orderBy: name) {
    name
  }
}

with variables:

{
  "start": 0,
  "end": 4
}

returns:

{
  "data": {
    "iwRegions": [
      {
        "name": "Eastern Cape"
      },
      {
        "name": "Garden Route"
      },
      {
        "name": "Gauteng"
      },
      {
        "name": "Kwazulu Natal"
      },
      {
        "name": "Limpopo"
      },
      {
        "name": "Mpumulanga"
      },
      {
        "name": "Northern Cape"
      },
      {
        "name": "Northwest Province"
      },
      {
        "name": "Western Cape"
      }
    ]
  }
}

If I hard-code the values as follows:

query getRegions {
  iwRegions (range: [0, 4], orderBy: name) {
    name
  }
}

I get the correct response:

{
  "data": {
    "iwRegions": [
      {
        "name": "Eastern Cape"
      },
      {
        "name": "Garden Route"
      },
      {
        "name": "Gauteng"
      },
      {
        "name": "Kwazulu Natal"
      },
      {
        "name": "Limpopo"
      }
    ]
  }
}

Any ideas?

Thanks,
Adrian

@koskimas
Copy link
Collaborator

Seems to be a bug. I'll fix that asap.

Thank you for an excellent issue by the way! Clear issues like this with actual data and a reproduction are very rare 👍

@koskimas koskimas added the bug label Nov 10, 2017
@Trellian
Copy link
Author

Kind words indeed... Thank you for an awesome library, and happy bug-hunting :)

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

No branches or pull requests

2 participants