We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
{ "node": "v14.4.0", "os": { "platform": "darwin", "release": "19.5.0" }, "nexus": "0.24.2", "plugins": [ "nexus-plugin-prisma" ], "otherDependencies": {}, "devDependencies": { "@typescript-eslint/eslint-plugin": "3.4.0", "@typescript-eslint/parser": "3.4.0", "eslint": "7.3.1", "eslint-config-prettier": "6.11.0", "eslint-plugin-prettier": "3.1.4", "prettier": "2.0.5" }, "hasAppModule": true, "packageManager": "yarn", "errorsWhileGatheringReport": { "gettingLayout": null, "gettingPluginManifests": null } }
API setup (with schema.queryType and basic crud definitions added):
import { use } from 'nexus' import { prisma } from 'nexus-plugin-prisma' use(prisma({ features: { crud: true } }))
Nexus crud Queries run in GraphiQL or other clients works as expected.
However when called via a Next.js + ApolloClient SPA locally, nexus gives the error:
BadRequestError: request.body json expected to have a query field
But in the network inspector: the requesy.body query field does appear to be present:
And the ApolloClient responds with the following, as it doesn't get a json response from the 400:
JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
It's not clear to me if this is a nexus or an apollo issue, any clarificaiton or insight would be helpful!
Many Thanks,
James.
Follow nexus + prisma, and next.js + apollo, setup guides: https://www.nexusjs.org/#/plugins/prisma https://github.com/vercel/next.js/tree/canary/examples/with-typescript-graphql
The text was updated successfully, but these errors were encountered:
Changed app.ts to this (and a few other changes in Apollo) seemed to fix the issue, not entirely sure why:
import { use, server } from 'nexus' import { prisma } from 'nexus-plugin-prisma' import cors from 'cors' use(prisma({ features: { crud: true }, paginationStrategy: 'prisma' })) server.express.use(cors())
Seemed to be down to cors not being configured, can we get cors support built in?
Sorry, something went wrong.
For built in cors support please +1 graphql-nexus/nexus#380
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Nexus Report
Screenshot
Description
API setup (with schema.queryType and basic crud definitions added):
Nexus crud Queries run in GraphiQL or other clients works as expected.
However when called via a Next.js + ApolloClient SPA locally, nexus gives the error:
But in the network inspector: the requesy.body query field does appear to be present:
And the ApolloClient responds with the following, as it doesn't get a json response from the 400:
It's not clear to me if this is a nexus or an apollo issue, any clarificaiton or insight would be helpful!
Many Thanks,
James.
Repro
Follow nexus + prisma, and next.js + apollo, setup guides:
https://www.nexusjs.org/#/plugins/prisma
https://github.com/vercel/next.js/tree/canary/examples/with-typescript-graphql
The text was updated successfully, but these errors were encountered: