popular-magentaP
Refine2y ago
35 replies
popular-magenta

Dataprovider resulting in String instead of Int

I am using the Hasura dataprovider, and i've passed the following

const gqlDataProvider = dataProvider(client, {idType: "Int"});
Expecting it to give an Int, but it keeps giving me a string, when my schema needs an Int.

Coming from this query

export const COMPANY_TITLE_QUERY = gql

    query CompanyTitle($where: ID!) {
        companies(where: $id) {
            id
            name
            createdAt
            avatarUrl
            salesOwner {
                id
                name
                avatarUrl
            }
        }
    }
;

Which is from the onFinish function.
Why isnt it passing an int? And the where variable?

This is the payload

{,}
operationName
:
"CompanyTitle"
query
:
"query CompanyTitle($where: ID!) {\n companies(where: $id) {\n id\n name\n createdAt\n avatarUrl\n salesOwner {\n id\n name\n avatarUrl\n }\n }\n}\n"
variables
:
{id: "21"}

Response

{
"errors": [
{
"message": "expecting a value for non-nullable variable: "where"",
"extensions": {
"path": "$",
"code": "validation-failed"
}
}
]
}
Was this page helpful?