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 simple react component that must load data from server when user ask it. Problem is that i don't know how to transfer dynamic variable speakerUrl and access it in before component load state. Sure i can access it from this.props.params,...
I am in the process of learning graphql and react-apollo. I have set up a search query in my code. I am unsure how to pass a variable from my code (i.e. this.state.search) to my grapnql call.  I have looked at many answers including this one, but it...
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...
After a login mutation, a jwt token and a user object (id and firstName) are returned and stored in cache (as shown in the image below).    I want to retrieve the user informations from the cache by using readFragment and pass it to Layout component....
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...
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 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!) {...
I have a mutation like  mutation deleteRecord($id: ID) {     deleteRecord(id: $id) {         id     } }   and in another location I have a list of elements.   Is there something better I could return from the server, and how should I update the list?...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.