graphql-yoga | Fully-featured GraphQL Server | GraphQL library
kandi X-RAY | graphql-yoga Summary
kandi X-RAY | graphql-yoga Summary
Easiest way to run a GraphQL server:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of graphql-yoga
graphql-yoga Key Features
graphql-yoga Examples and Code Snippets
Community Discussions
Trending Discussions on graphql-yoga
QUESTION
I am learning GraphQL and am developing a Contact Manager App using Node.js and my database is MongoDB. The add and delete mutation are working fine but whenever I try to run update mutation it throws error. I'm on Windows machine running on windows 10 20H2. Text editor is VS Code. Terminal is windows powershell and I'm using npm to run the program.
This is my ./graphql.js
file
ANSWER
Answered 2021-Mar-27 at 05:41You should look up the User
document by _id
and not id
. And you don't need to call save
since findOneAndUpdate
already does the update.
QUESTION
I am currently loading the GraphQL schema using a separate .graphql
file, but it is encapsulated within strings:
schema.graphql
ANSWER
Answered 2020-Jun-09 at 20:59Figured it out using fs
(thanks to Tal Z):
index.js
QUESTION
- Version: v12.19.0
- Platform: Linux ayungavis 5.4.0-48-generic #52~18.04.1-Ubuntu SMP Thu Sep 10 12:50:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem:
I tried to follow the tutorial from Adding a Database to GraphQL, this is the code of my script.ts
:
ANSWER
Answered 2020-Oct-12 at 07:17It seems that your issue is related to this. Currently there's an issue with Node.js version 12.19.0 that Heroku uses and there's a dependency named undici
that's causing the issue. It should work if you try it with Node 14 in Heroku.
QUESTION
thx for any help.
Im using at the frontend the apollo-client and at the backend graphql-nexus,prisma2 and graphql-yoga server.
I want to solve the n + 1 problem with @paljs/plugins.
At the frontend I have a query posts like:
...ANSWER
Answered 2020-Oct-07 at 17:56You need to know that to use my PrismaSelect
plugin you need to remove the nexus-prisma-plugin
package and use my Pal.js CLI to create your CRUD and ObjectType for nexus and using @paljs/nexus
plugin to add in mackSchema
function
QUESTION
im using graphql-yoga and prisma i made user and post datamodel. a user can have many posts
i did like below. now according the addPost
mutation i want to add new post that is related to current user. but graphql server return the following error
but when i run the mutaion:
...ANSWER
Answered 2020-Jul-07 at 14:12It should be:
QUESTION
I am working with GraphQL, Graphql-yoga and NodeJS.
I have problems accessing my DB array when is nested within my GraphQLServer context. Everything works fine when my GraphQLServer context is configured with a single element as shown here: (db is an array to simulate DB content).
When I add curly braces to it, it breaks:
Even if i don't see any error while coding, when trying to execute any of my resolvers seems they cannot access the DB object anymore and all my find(), findIndex(), some() and all the methods that are associated to my DB array are not working anymore. If I set back to: context: db everything works perfectly.
This is the error I get when running TypeError: Cannot read property 'findIndex' of undefined
This is how my resolver looks like:
Even if I destrcuture context to work directly with the array in my resolver I still get the same error:
This is my package.json:
Any help is highly appreciated.
...ANSWER
Answered 2020-May-05 at 22:56If you do this:
QUESTION
I've created a graphql server using graphql-yoga
and using volatile
as the database for my application.
So far posting works good, i'm facing issues trying to get the data i've added to the database.
Here is my code so you can help me figuring out what i'm doing wrong.
In my schema I have the next.
...ANSWER
Answered 2020-Apr-13 at 21:06this resolver ...
QUESTION
I'm currently using graphql-cli from Prisma to download the schema from endpoint. But, even after I deploy the changes I made to my schema, which gets deployed successfully, whenever I try to download the schema, I get project prisma - No changes
. And the generated prisma.graphql
is left unchanged.
I use the following command to download the schema:
...ANSWER
Answered 2020-Jan-27 at 13:11To fix the error "variable to satisfy the declaration 'env:PRISMA_ENDPOINT' could not be found." when calling prisma generate
you should either set the PRISMA_ENDPOINT
variable manually or load it via dotenv
. For example you could run npx dotenv -- prisma generate
to load the env vars from your .env file.
To download the schema from the endpoint via graphql get-schema
make sure to provide a properly configured .graphqlconfig.yml
and provide the correct project.
A sample configuration for a prisma project could look like this:
QUESTION
I'm getting the following error when I'm deploying my app to Heroku:
...ANSWER
Answered 2020-Jan-13 at 05:22_babelrc
is not a recognized config format file for babel-- in order to configure babel you'll need to use one of the methods listed in their config files documentation:
.babelrc
.babelrc.js
.babelrc.cjs
package.json
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install graphql-yoga
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page