Tag: apollo
-
how to add product to shop cart via apollo and react
0 I try to use useMutation to add product to cart by button click, but after a lot of attempts it still don’t work and i can’t understand how to make it work. my code looks like that: product.jsx const [add, {error: addError}] = useMutation(ADD_CART, { update(cache, { data: { add } }) { cache.modify({…
-
How can I get schema from graphql?
0 I have a field There are values inside SignificanceLevelType : How can I get these values in frontend if there aren’t a special query for this? When I sent: query { protectedNaturalAreas { edges { node { significanceLevel } } } } I got significanceLevels in protectedNaturalAreas, but I want to get existing areas…
-
How can I parse a custom scalar in Apollo Client?
0 How can I return a Decimal type from my backend GraphQL server and then parse it on my frontend client? I have a backend that returns a product with a price. The price is a custom scalar of Decimal type. The schema is like so: scalar Decimal type Product { id: ID! price: Decimal…
-
Strapiv4 & apollo graphql, sort results by multiples dates
0 I have a list of articles, which have several dates attached to them : publishedAt (default date generated by strapi when article created) date (manual date user can enter to alter the default date) updateDate (manual date user can enter to print a second date, mentioning that the article was updated, and when) Basically…
-
Apollo Federation supergraph query gives an error
2 I got most of the tutorial up and running just fine, i.e subgraph creation, publishing subgraphs to Apollo Studio, and setting up the router. When I try to run a unified query on the supergraph, however, I get the following error, 2022-11-10T19:20:59.880454Z apollo-router/src/services/subgraph_service.rs:173 ERROR [trace_id=dc031984b0655a46580ce9ac8c7fd6e6] apollo_router::services::subgraph_service: fetch_error="hyper::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error:…
-
Error: Unable to find GraphQL endpoint. While trying to generate post type object
0 Im trying to setup a headless WP project using faustjs, WPgraphQL and ACF. Later im planning to also implement Shopify shopfront API. I was setting up the project, installing all the plugins and setting them up. So i have setup my .env.local and i have setup the faust settings in the WP admin panel.…
-
Resolve two GraphQL schema fields using one endpoint
2 There’s a situation where there are two possible types to fill data property. I have made a union type for that (ComponentItem) to determine which field needs to be returned. The first schema (ComponentItem1) should just be a hardcoded list but the second one (ComponentItem2) is more dynamic where it gets a searchTerm from…
-
String cannot represent value: { success: false, status_code: 34, status_message: “The resource you requested could not be found. } GraphQL Error
0 Anyone please helppppp!!! I am trying to use TMDB movie api to post a rating, check out the link here for their docs:https://developer.themoviedb.org/reference/movie-add-rating, however i face an issue that it keeps showing me the below error when i implement to Graphql code for Mutation, how do i solve it: "errors": [ { "message": "String…
-
Unable to receive raw GraphQL subscription updates using Apollo-Angular 4.2.1 and Multipart HTTP protocol
0 I m using apollo-angular 4.2.1. Our backend team has drop websocket using graphql. we are using Multipart HTTP protocol for GraphQL subscriptions following is my setup for apollo client export function createApollo(httpLink: HttpLink): ApolloClientOptions<any> { loadDevMessages(); loadErrorMessages(); return { link: httpLink.create({ uri, headers: new HttpHeaders({ "Accept": ‘multipart/mixed; boundary="graphql"; subscriptionSpec="1.0", application/json’ }) }), cache: new…