graphql

`Extensions` field not shown in apollo graphql response data

我们两清 提交于 2021-02-10 13:20:30
问题 Here is a reproducible example. Run app.js and navigate the playground at http://localhost:4000/graphql You can run queries like: query RecipeQuery{ recipe(title:"Recipe 2"){ description } } Problem: I need debugging information from the extensions field in the response data. I'm talking about this extensions field: "data":{....}, "extensions": { "tracing": {} "cacheControl":{} } But in reality, I'm only getting the data field: "data":{....} I have already enabled tracing and cacheControl in

Apollo Client: retrieving the results from a query with errors

不问归期 提交于 2021-02-10 12:00:56
问题 I'm using the GraphQL Apollo Client. And I'm trying to retrieve the results from a query with errors. GraphQL response How do I retrieve the data, even when an error is returned in the same response? This automatically catches the error. Instead, I want it to access the data. this.client.query({ query: gql(query), variables: variables }).then(function ({ data }) { return data; }).catch(error => console.log(error)); Couldn't find anything in Apollo docs about this. Any ideas? 回答1: if you

Apollo Client: retrieving the results from a query with errors

夙愿已清 提交于 2021-02-10 11:57:12
问题 I'm using the GraphQL Apollo Client. And I'm trying to retrieve the results from a query with errors. GraphQL response How do I retrieve the data, even when an error is returned in the same response? This automatically catches the error. Instead, I want it to access the data. this.client.query({ query: gql(query), variables: variables }).then(function ({ data }) { return data; }).catch(error => console.log(error)); Couldn't find anything in Apollo docs about this. Any ideas? 回答1: if you

React Uncaught Invariant Violation: Could not find “client” in the context of ApolloConsumer. Wrap the root component in an <ApolloProvider>

不想你离开。 提交于 2021-02-10 08:32:03
问题 I have a React app using react-apollo:2.5.8 and a library of custom components that I install via NPM and use within the app. The library has react-apollo:2.5.8 listed in peer and dev dependencies. Ever since I upgraded react-apollo to 2.5.8 I have been getting this error `Uncaught Invariant Violation: Could not find "client" in the context of ApolloConsumer. Wrap the root component in an <ApolloProvider>.` I tried listing React-apollo within externals in the Webpack build for the library as

React Uncaught Invariant Violation: Could not find “client” in the context of ApolloConsumer. Wrap the root component in an <ApolloProvider>

佐手、 提交于 2021-02-10 08:31:50
问题 I have a React app using react-apollo:2.5.8 and a library of custom components that I install via NPM and use within the app. The library has react-apollo:2.5.8 listed in peer and dev dependencies. Ever since I upgraded react-apollo to 2.5.8 I have been getting this error `Uncaught Invariant Violation: Could not find "client" in the context of ApolloConsumer. Wrap the root component in an <ApolloProvider>.` I tried listing React-apollo within externals in the Webpack build for the library as

Shopify GraphQL Admin API rate limiting cost and sleep time

筅森魡賤 提交于 2021-02-10 06:14:35
问题 I am trying to consume Shopify GraphQL API for Admin in PHP ( Laravel ). Rate limiting and throttling works differently in GraphQL api as compared to REST api, its calculated based on the cost of the query. Few points to keep in mind: Maximum available cost is 1000 for one api call (query). If you have consumed some points from 1000, every second, 50 points will be restored. If you have less points of cost in your bucket, and you make a query of cost higher than that, it will throttle. The

Shopify GraphQL Admin API rate limiting cost and sleep time

倾然丶 夕夏残阳落幕 提交于 2021-02-10 06:14:18
问题 I am trying to consume Shopify GraphQL API for Admin in PHP ( Laravel ). Rate limiting and throttling works differently in GraphQL api as compared to REST api, its calculated based on the cost of the query. Few points to keep in mind: Maximum available cost is 1000 for one api call (query). If you have consumed some points from 1000, every second, 50 points will be restored. If you have less points of cost in your bucket, and you make a query of cost higher than that, it will throttle. The

Missing query attribute on result Vue graphql

两盒软妹~` 提交于 2021-02-09 10:53:52
问题 I can't understand why this error occurs in the console import gql from 'graphql-tag' // import gql const getBooksQuery = gql`query // describing query { books{ name id } } `; export default { name: "BookList", // template name apollo: { // apollo instance query: getBooksQuery // query } } What am i doing wrong? 回答1: You have to name the apollo property (docs, e.g bookList ): export default { name: "BookList", // template name apollo: { bookList: { query: getBooksQuery // query } } } or even

How to limit and skip after grouping in a GraphQL query to paginate the tags list page?

南楼画角 提交于 2021-02-08 16:24:22
问题 I'm trying to paginate the blog tags list page in a Gatsby site, the tags are defined in the frontmatter of the MDX files: --- title: Blog Post Title date: 2020-05-20 tags: ["Markdown", "Gatsby", "JavaScript"] --- Paginating the posts is easy using limit and skip passed in the page context object: query Posts($limit: Int!, $skip: Int!) { allMdx( sort: { fields: frontmatter___date, order: DESC } limit: $limit skip: $skip ) { nodes { ... } } But this doesn't apply for paginating the tags list

How to limit and skip after grouping in a GraphQL query to paginate the tags list page?

寵の児 提交于 2021-02-08 16:21:56
问题 I'm trying to paginate the blog tags list page in a Gatsby site, the tags are defined in the frontmatter of the MDX files: --- title: Blog Post Title date: 2020-05-20 tags: ["Markdown", "Gatsby", "JavaScript"] --- Paginating the posts is easy using limit and skip passed in the page context object: query Posts($limit: Int!, $skip: Int!) { allMdx( sort: { fields: frontmatter___date, order: DESC } limit: $limit skip: $skip ) { nodes { ... } } But this doesn't apply for paginating the tags list