I have this in my complicated app: Basically, I have an export button which will export a CSV of my GraphQL data. I manually call client.query to fetch the latest data on click of the button, but it throws an error saying it can’t find the used fragment StuffTable. How do I include that fragment in the query? I am
Tag: graphql
GraphQL – “Field “updateOwner” of type “Owner!” must have a selection of subfields. Did you mean “updateOwner { … }”?”
I’m trying to get Mutation Update query in GraphQL Playground. I’m basic level in GraphQL and in learning phase. I don’t know how to create udpate Mutation for the below Owner code. Any idea what I’m missing in my code / query? —Resolver— —Service— —dto— —entity— —schema— —GraphQL Query (I don’t know whether it is correct or wrong) —error— Answer
How to Make a ShopifyQL query?
Shopify recently announced ShopifyQL for easier accessing of analytics data. However, I’m unclear of how to actually make a ShopifyQL call. They do include an example. However, using the GraphiQL tool to run the query hits a number of errors: I also tried making an authenticated call with the example query above using my app’s Node server, but ran into
Apollo Client useQuery making un-necessary refetches upon Next.js router.push
I’m dealing with an issue in which a query inside a useQuery Apollo Client hook is getting un-necessarily re-run whenever Next.js’s router.push (docs here) is called. The abbreviated code is: You can see a reproduction on CodeSandbox here. My expectation is that whenever the button is clicked (and thus router.push is called), the query shouldn’t be re-run. However, it’s re-run
Error: No “exports” main defined in graphql-upload/package.json
Have installed graphql-upload, do import { graphqlUploadExpress } from ‘graphql-upload’; And getting this error: Error: No “exports” main defined in graphql-upload/package.json Dependencies: The version of node: v16.10.0 Answer So the problem was in the .default build settings. You can remove it, but when we removed it we saw the problem with other modules, so we resolved this issue via this:
Programatically generating Gatsby pages without a slug from Graphql
I have set up an ACF options page in WordPress called Projects Inside the Projects options page there is an ACF repeater allowing the user to add multiple Projects. In Gatsby, I’m using Graphql to query the data for my Projects in two files: Inside a custom hook, allowing access to the data globally in my Gatsby site Inside a
MongoDB & Prisma: unilateral M-to-N relation
Is there a way to make an unilateral m-to-n relation or must both collections have each other’s ids? I’m trying to do something like this: But prisma is making me add another field to Country to store the users ids… Like this: I don’t need that data and it’s not logically needed. Is there any way to bypass that? Any
Get an array of items from an object- typescript
I have an object with the below structure: the order is of type Order[] and users of type UserData[] Whenever I try to get the list of users per order : let users = this.Order.users it says that: users don’t exist on type Order[], can anyone explain for me why. Answer Order is an array of objects, you need to
Saving the state of the button onClick
I have: This pattern works fine, but whenever on the page more then 1 attribute and user select more then one, previously selected button gets unclicked. My question is: How can I save the state of 1st selected button after clicking on 2nd one? for each attribute only one button can be active buttons name should be used Answer You
unknown directive “@isAuthenticated”. Using Neo4j and Graphql
I’m trying to do something like this : but when I do that in my graphql.schema : I get this error : how am I supposed to add the directives? Answer The right way to do that with Neo4jGraphql was : see this doc for more informations : https://neo4j.com/docs/graphql-manual/current/auth/