-2

I am trying to make a request that takes a variable for the distinct_on parameter, but what I have doesn't seem to work:

query customers($distinct: String!) {
  customers(limit: 20, distinct_on: $distinct) {
    startDate
    endDate
  }
}

I am assuming the String type is not what is expected, what type should I be using for $distinct?

Philip-lf
  • 105
  • 2
  • 7
  • When posting questions, it's helpful to include any errors you are seeing and providing as much detail as possible. Saying something "doesn't work" isn't very helpful to anyone volunteering their time to help you with your problem. – Daniel Rearden Jan 17 '20 at 02:32

1 Answers1

-1

The type for your variable will be a table-specific enum as documented here.

Your entire schema should be viewable through the GraphiQL interface of the Hasura console -- you can use this to lookup types for fields and arguments. You can also check the error returned by the server -- it will include details about what went wrong with your query, including the type that was expected.

Daniel Rearden
  • 80,636
  • 11
  • 185
  • 183