After I'm sending a createMessage mutation in my app, I want to update the local ApolloStore using updateQueries.  My setup looks as follows:  const ChatWithAllMessages = graphql(allMessages, {name: 'allMessagesQuery'})(Chat) export defau...
I have a queries file that looks like this:  import {gql} from 'react-apollo';  const queries = {   getApps: gql`     {       apps {         id         name       }     }   `,   getSubjects: gql`     {       subjects {         id         name...
I have a <Query /> in my Home.js file  Home.js  <Query       query={GET_TODOS_BY_PRODUCT}       variables={{ id: state.get("selectedProduct.id"), completed: true }}     >       {({ data: { product } }) => {         return <M...
I have a React app accessing GraphQL server with the Apollo Client (version 1.x). There is a server schema that looks like this.  type Query {   currentShop: Shop } type Shop {   id: ID!   name: String!   products: [Product!]!   ...etc }   I do have...
GitHub's new GraphQL API requires authentication with a token as the previous version. So, how do we add a 'Header' information into the HttpLink inside Apollo-Client?  const client = new ApolloClient({   link: new HttpLink({ uri: 'ht...
I have two GraphQL type:  type Author {   id: String!   name: String! }  type Book {   id: String!   author: Author!   name: String! }   In my database, it is implemented by a foreign key inside the books table:  table authors (pseudo code)  `id` INT...
I'm working on this library https://github.com/ilyaskarim/wertik-js called Wertik JS to make GraphQL + Rest API more easily, In resolvers, when I console log info, it shows undefined. For each module, I have created dynamic resolvers to make thin...
A very strange one here, so if anybody can shed light on it I will be impressed.   Good  When I use a <h1 /> inside a component and build the server with npm run dev everything will work as expected.  I can replace the h1 with the <Query /&g...
I'm trying to use apolloFetch inside a Promise.all in my Node.js microservice but keep getting an error that the query is empty. The reason for using apolloFetch is to call another micro service and pass it an array of queries. Can someone give m...
I'm using GraphQL subscriptions for my chat application, but I have an issue with the UI updates.  Here are the query and the mutation I'm using:  const createMessage = gql`     mutation createMessage($text: String!, $sentById: ID!) {...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.