Hi guys,  whenever I run the request function of m...
# orm-help
d
Hi guys,  whenever I run the request function of my GraphQLClient (graphl-request library) it returns an error but the error contains the correct result. I found this https://github.com/prisma-labs/graphql-request/issues/140 problem but ever after setting the headers it still causes issues: My graphql client:
Copy code
GraphQLClient {
  url: '<https://api.devprtcl.com/v1/graphql>',
  options: { headers: { Accept: 'application/json' } }
}
The response:
Copy code
Error: GraphQL Error(Code: 200): {
    "response": {
        "error": "{\"data\":{\"property_authentication\":[{\"property\":\"0xcEBD1BF31DF3E3697Ea26e2F94F9E3644C809F46\"}]}}",
        "status": 200
    },
    "request": {
        "query": "{ property_authentication(where: {authentication_id: {_eq: \"vue-i18n\"}}) {\n\t\tproperty\n\t  }\n\t}"
    }
}
at GraphQLClient. < anonymous > (/home/daan / badge / node_modules / graphql - request / dist / index.js: 134: 35)
at step(/home/daan / badge / node_modules / graphql - request / dist / index.js: 44: 23)
at Object.next(/home/daan / badge / node_modules / graphql - request / dist / index.js: 25: 53)
at fulfilled(/home/daan / badge / node_modules / graphql - request / dist / index.js: 16: 58)
at processTicksAndRejections(internal / process / task_queues.js: 97: 5)
r
Are you doing a
stringify
before returning from the resolver or are you returning the object? (returning the object should work)
d
Hey @Richard Ward thanks for reaching out to me! I was just returning the object asfaik.. In the end I went for the old fashioned fetch function which does the job as well 😅