Given the following GraphQL request and variables:
Request:
query accounts($filter:AccountFilter, $first_:String, $skip_:Int) {
accounts(filter: $filter, first: $first_, skip: $skip_) {
id
}
}
Variables:
{
"filter": {},
"first_": "3",
"skip_": 0
}
Note: I added underscores to the first_ and skip_ variable names to help distinguish them from the arguments first and skip.
I'm getting the following errors:
"Type mismatch on variable $first_ and argument first (String / Int)"
"Type mismatch on variable $skip_ and argument skip (Int / Int)"
The first error I created on purpose as a sanity check. The value in the variables should be "first": 3, and not "first": "3",. The second error I don't understand why I'm getting it. How is Int and Int Type mismatched? The first variable/argument error reoprts the same error (Int / Int) when I correctly pass 3 and change String to Int.
What am I doing wrong?
Backend Specs: Ruby on Rails
Argument Specs:
"""
Interface for the Account model
"""
type Account {
friendlyId: String!
id: ID!
locations: [Location!]!
name: String!
participants: [User!]!
primaryLocation: Location!
primarySiteContact: User!
siteContacts: [User!]!
}
input AccountFilter {
OR: [AccountFilter!]
}
type Query {
"""
Details for an Account
"""
accountDetails(id: ID): Account
"""
A list of Accounts
"""
accounts(filter: AccountFilter, first: Int, skip: Int): [Account!]
}