graphql.js | GitHub GraphQL API client for browsers and Node | Runtime Evironment library
kandi X-RAY | graphql.js Summary
kandi X-RAY | graphql.js Summary
GitHub GraphQL API client for browsers and Node.
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.js
graphql.js Key Features
graphql.js Examples and Code Snippets
Community Discussions
Trending Discussions on graphql.js
QUESTION
I have a custom controller to replace a default querie named "groupedOrders" but when I try to test the query the response is
"message": "Cannot read property 'user' of undefined",
the code in api/grouped-order/controllers/grouped-order.js is:
...ANSWER
Answered 2021-May-20 at 03:02Solved, I just add this code on my controller:
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 had a very frustrating evening yesterday, trying to get the basic Shopify GraphQL Admin API example working with nodeJS. The original Shopify example code is here.
The problem is that my code returns a status 400 - Bad Request.
I have enabled a "private App" on my store and enabled all the APIs with read access. I carefully copied the apiKey, accessToken and store name from Shopify.
Can anyone point out if there is something wrong with my code? Many thanks.
Code:
...ANSWER
Answered 2021-Mar-07 at 10:00It looks like you are sending body incorrectly. The way you are sending your body results in {body: { query: { shop { name } } } }
Instead of:
QUESTION
I am stuck on this for more than two days now. I couldn't able to find any resources on this. There are many solutions by using ADMIN API but I don't have Admin access. Problem I am trying to solve is: I have only access to Product's SKU. I need to fetch all other information(title, price, description, featuredImage etc...) from Shopify using Storefront API. Here's the function to get product:
...ANSWER
Answered 2021-Feb-28 at 22:00You can't query the products by SKU using the StoreFront API.
The available query params for the StoreFront products are:
- available_for_sale
- created_at
- product_type
- tag
- title
- updated_at
- variants.price
- vendor
So you can't do this only with the StoreFront API since the SKU is not exposed (like the Admin API).
QUESTION
I have tried to modify the schema to add a ingredients String line. From this code I am pretty much following it to a tee https://github.com/dabit3/next.js-cdk-amplify-workshop you can look in the backend and frontend folders to see all the code
I have built and deployed with cdk
My error is at the bottom
Any help would be great
Here's the relevant parts of the schema in the backend
...ANSWER
Answered 2020-Dec-20 at 19:41It seems like there are some debugging details missing from your question. For example, your error message displays the results of a listPosts
query, but you don't show that being called anywhere. Also, that query apparently returns something, so it would be good to see the database entries backing it.
If I had to guess, you have entries in your dynamo table that have missing ingredients
fields, which is why you see an error: the query is trying to marshal missing/null fields to a return type of String!
, which is by definition non-nullable.
Also, I'm not sure you should be setting id
directly on your post
state object. Better to copy the object and set the property on the copy, esp since you're just using it as a parameter.
QUESTION
I'm using NestJS, TypeORM and GraphQL for my backend API. I'm getting the following error:
...ANSWER
Answered 2020-Sep-28 at 16:24All servers running with GraphQL must have at least one @Query()
to be considered a valid GraphQL server. Without it, the apollo-server package will throw an exception and the server will fail to start. This can be as simple as
QUESTION
I installed the Vuex-ORM Graphql Plugin into an existing Nuxt project with Laravel/GraphQL API, so that I could try avoiding using the Apollo Cache. In one of my components though, I'm running:
...ANSWER
Answered 2020-Nov-25 at 15:48So in a Hail Mary throw to get this working, I ended up making a couple of changes that actually worked!
If other people come across this having similar issues, here's what I did... In my nuxt.config.js, swapped the order of the two plugins to this:
QUESTION
I mostly work on front-end so I'm not super familiar with NodeJS. I'm working on a Shopify Custom App and purpose of this app is when order placed it will receive webhook request and with that request it will send some data to other API (billing application)
I built shopify app with shopify app cli and my server.js file is like this;
...ANSWER
Answered 2020-Nov-03 at 20:52The session is created only for the user who logged in the app from the admin panel. This is true for the online method for creating an access token.
If you are requesting the access token from a webhook request (a.k.a a request that doesn't require you to relogin in the app) you will not be able to access the session and you will not be able to get the access token. In addition the session expires at some point.
In order to use the Access Token in a webhook request you need to create an offline
access token which is valid indefinitely. createShopifyAuth
has an option for creating an offline access token, you just need to add accessMode: 'offline'
to your request (more on this here)
Example:
QUESTION
I'm reconfiguring my NextJS/Apollo app to allow for SSG with GraphQL API routes, and I'm using this official NextJS starter example as a base for the client config.
I've run into an interesting issue though in my own app, so I've went back to starter example and tried to reproduce it, and was able to. The issue is that without any context object passed into the query resolvers, everything works fine (in the playground and on the client). However, when you introduce a context object and pass it to the resolvers, it works fine in the playground but the context object is undefined
when fired from the client. This is the code from the official NextJS starter example, I'll comment where I've added anything.
graphql.js
ANSWER
Answered 2020-Oct-09 at 21:00I've figured out the problem. The client configuration is using SchemaLink
for the http request, and the context is passed in the SchemaLink
constructor function, not in the server options, because context is passed in the http headers with httpLink.
QUESTION
I've got a Nuxt app with a Checkout page, and on the backend I'm using Strapi GraphQL. I created several coupons in Stripe, and I want to be able to verify the coupons from the Checkout page, but I'm struggling to figure out how to do this. Here's what I have so far:
Frontend (Nuxt)
Cart.vue:
...ANSWER
Answered 2020-Jun-19 at 23:30Well, your code to look up coupons on Stripe looks just fine! Looks like Strapi expects your service to be at ./order/services/order.js
—could it be as simple as that? Your example shows it at ./order/controllers/order.js
. https://strapi.io/documentation/3.0.0-beta.x/concepts/services.html#custom-services
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install graphql.js
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