React-apollo Questions
Ad
React scroll to element after render
I am creating an app using react and apollo graphql. part of my app consist of showing a list of options to the user so he can pick one. once he
Correct pattern for using <Query> in other class methods
I understand apollo prefers we use <query> in our render methods to do queries, rather than
How to access fetch policy in local resolver using Apollo Graphql React client
I am creating an app using react and the apollo graphql client. this app must have a local resolver to retrieve data from a legacy rest api and
Can I read each response from batched mutations? [Apollo useMutation]
Let's say i have defined a mutation like this: const [deleteitem, {data}] = usemutation(deleteitemmutation) and then
refreshing a token with apollo-client + firebase auth
I'm having some trouble figuring out token refreshes when using apollo-client and firebase's auth service. i've setup token refresh using
Cannot receive error from GraphQL with graphql-middleware-sentry
Note: the problem was in graphql-middleware-sentry not forwarding on the errors. the solution is below and marked as the correct
React Apollo Client - modify query data before it goes to cache
Is there a way to modify query response data before it is saved in the internal cache? i'm using apollo hooks, but this question is relevant to
useLazyQuery not firing in Promise all
I'm trying to refetch the data in from a apollo server but cant get it to work. i do two mutaions and push them into an array. i then want to,
React Apollo updating client cache after mutation
I am trying to update my chache after succesfully executing a mutation. here is my query and mutation: export const dojo_query =
Apollo Client resolver only triggers once
I'm currently working on a react app, that uses a graphql backend and has additional local state. i am using a resolver to resolve a local field
Ad
React Apollo Query based on a condition
I'm currently building an app (hybrid mobile app) to show a list of records (places). following is my requirement, 1) if the app is
Apollo GraphQL, is there a way to manipulate the data that is being written to the cache during querying?
According to apollo graphql docs, apollo links can go in two directions - client -> server and server -> client:
Function executes before component is updated
You can find the codesandbox here i am very new
compose not exported from react-apollo
I'm following a graphql tutorial on youtube
How can I call the function clinet.query through the function?
I would like to call the client.query through function however it does not work. for example, when the user click a button, i want to call a
How to use mutations in react-apollo-hooks and formik?
In my many attempts, i've tried to use react-apollo-hooks and formik together but it seems impossible. the data from the forms is only available
Next Js Custom Routes and SSR
I am using apollo with next and recently i noticed that custom routes breaks ssr. usually if you navigate through pages apollo caches the query
Typescript - Using a value from then in function return block
I have this function: function configureclient(): apolloclient<apollocache<any>> { let mytoken =
How to fix "TypeError: Object(...) is not a function" when using a wrap function on React Component to authenticate user login with Browser Router
I am build a react application and working on it's user authentication. currently i am using browserrouter from 'react-router-dom' to manage
Cannot read proper query in GraphQL Apollo Client
On one of my pages in my app i'm doing two api calls with graphql apollo client. one is document, the other one menu. i
How do I assign values to states once I open my edit form?
I'm trying to create my first simple crud front-end app in react. i have some problems with the edit form. whenever i display the edit
Ad
Call Typescript Apollo Query from componentDidMount()
I have a react component that calls a query that expects to receive an array of objects (for validation data). i then use it to validate an html
apollo client returning undefined in initial reload in react native
I'm trying to fetch some data from my cache. in initial reload data prop returns undefined but if i fast reload the app (react native fast reload)
How to write HOC for React Apollo Query component in TypeScript?
I'm trying to write hoc for displaying info of used query in component like this: const get_rates = gql` query ratesquery {
With Apollo React client, why you not always need a resolver to resolve @client GraphQL queries?
I'm learning how to use apollo client for react and how to manage local state using the cache. from the
Update ApolloClient headers after it was initialised
My app is wrapped with <apollo /> component that essentially initialises the client. const client = new
How to implement Search Function in React-GraphQL using React-Hooks and Apollo Client?
I try to implement the search function into my management system using react-hooks and graphql-apollo client. while the interface is shown
Using `react-apollo-hooks` and `useSubscription` hook
I'm building a simple todo app using react, apollo and react-apollo-hooks for hooks support, but the usesubscription
React Apollo Testing is not working. Query data is always coming undefined
I am getting loading state only and data as undefined in testing. i don't know why i am following everything in the given example. please
How can I use the useQuery hook to populate state in other hooks?
I have been dealing with a few hook-related issues recently as i have been implementing hooks into a project of mine. i keep getting the error
apollographql - changes to entries in objects in local state & re-rendering?
Let's say i have an object in my local state and 2 types of query on that object: - anobject { __typename:
Change Apollo Client options for jwt token
I want to set up a token in my apollo client when the user logs in. this is my index.js: const client = new apolloclient({
Ad
React-Apollo: Query with variables causes the UI to no longer be optimistic
I'm writing a react component using apollo graphql (with react apollo hooks, but this makes no difference). here is my query:
Receiving error - Hooks can only be called inside of the body of a function component when implementing React Spring basic example
I have a next app. the code for the app itself (pages, static etc.) is in a folder in the repo. called
How to send list of ids as param with graphql
I'm using react, graphql and apollo. i have function as follows: updateslots(updateslots, data){ const {slotids,
{ apollo-client, react, grapgql } what is good way handle multiple loadings?
I am using react and apollo-client with graphql on node.js i have component which call three query so i have three loading like
<Mutation /> refetchQueries "Unknown directive "_"."
I am using react-apollo and the <mutation /> component with refetchqueries update_task
Apollo GraphQL local and global error handling
I'm using apollo to interact with a graphql server in a web application written in react. i'm trying to implement error handling in the
Type error: JSX element type '{} | null | undefined' is not a constructor function for JSX elements
I have a react component called handlequery that handles the results of an apollo graphql query: import react, {
Apollo Client State - object written to cache with writeData is missing
I have a problem with apollo client state in my react app. i'm creating my client state link in the following way: const statelink
How do I wait for a query to finish before making another query with graphql?
I have a query called get_me and another one called get_user_notifications. second one it's looking for user id which
this.props not accessible when using ApolloClient
I am using apollo-boost and i have created an apolloclient and i want to do some redirection after a mutation is run but i cannot access the
this.props.login is not a function react-apollo + compose + graphql
Import { graphql, compose } from 'react-apollo' import gql from 'graphql-tag' const authenticate_user_mutation = gql` query
Ad
Why is my custom hook called so many times?
I'm trying to implement a custom hook to provide the app with a guest shopping cart. my hook wraps around the usemutation hook from
Flickering with Apollo Queries
We use apollo graphql extensively in our e-commerce website and i'm having trouble with some unwanted flickering when the route changes.
react with GraphQL Clients
Using react with graphql clients like apollo client is a good idea? the same results i can achieve with
How to dynamically set variables in mutation with react-adopt?
In my component, i am using react-adopt, to compose graphql queries and mutations, so that my render props don't get too messy. i have the
Failed prop type: The prop `children` is marked as required in `Mutation`, but its value is `undefined`
I'm trying to write some information with apollo into a graphql/mongodb db, but there's always an error on the mutation. maybe someone
Map variable before executing Apollo mutation
I've been following this tutorial to
Prop I can access in component can't be rendered
My mern app's purpose is to take a 3-digit input from a user and return the first prime number that contains those digits (ex: you enter 026, the
Apollo mutation reset called state
I have an react-apollo mutation that is called when a user progresses a certain way through a playing video. the react player invokes
ReferenceError: require is not defined when importing ApolloClient from 'apollo-boost'
So i am getting this strange error, referenceerror: require is not defined when importing apolloclient from 'apollo-boost'.
How can I make sure I have data before component mounts?
A user clicks on a link and client reads token from url. then the token is passed to signup mutation. on the backend i have that
Why GraphQL shows first item from array as all items?
I'm trying to fetch items from graphql and receiving (looked at 'network' tab):
Ad
apollo-client used to make multiple requests to make a real-time search
We're developing a search engine inside an app with apollo and we do not know exactly how to develop a real-time search engine that makes a
Apollo refetching when using with React
We're developing our complete first app with apollo and we are having an issue when using it with react-router. we are using the new
I need to set my Apollo Client Cache to its defaults
I have a react app which is using apollo client. i'm using apollo-link-state and apollo-cache-persist and need to reset
React-Apollo - render getting called before getDerivedStateFromProps
I have a component that includes a verification form for a user. this component runs a graphql query upon mount. in the verification component, i
Can't Filter GraphQL query with Apollo and display database data object
I am trying to use a form input in react to filter my mongodb database with graphql and apollo. i have the backend set up and working. i have
ApolloClient: How to synchronize Apollo cache after update on the server?
I am trying to synchronize apollo cache after update on the server. should i write to the cache directly or can i refetch only updated data ?
How Apollo Query component use it's self value as callback
I was reading apollo documentation then i
How to Trigger a Mutation, react + Apollo 2.1
I have a mutation that is triggered when a button is clicked and returns a result. now i would love to trigger another mutation when that result
GraphQL error: Default value for $completedAt doesn't match type DateTime in React Apollo?
I have a mutation like this - import gql from "graphql-tag"; const completedat = new date().toisostring(); export const
refetchQueries in Mutation Component of React Apollo Client is not working?
I have a <query /> in my home.js file home.js <query
GraphQLError: Syntax Error: Cannot parse the unexpected character "\u00A0"
I get an error when i make a query/mutation/subscription with gql (from 'graphql-tag'). has anyone had this error and know how to fix it
Ad
Unsubscribe subscription in Apollo Client
In my component, i have this code: componentdidmount () { // setup subscription listener const { client, match: { params: {
Apollo weirdly alters the query result
I'm using react-apollos query-component in react native to get data from my backend. the result looks something like
The operation 'FooQuery' wrapping 'Foo' is expecting a variable, but it was not found with react-apollo
I'm having a problem with react-apollo. even not calling the query in foo class: the operation 'fooquery' wrapping 'foo' is
Using Apollo GraphQL refetch method from outside
My render function translatefileandrefetchquery = (urn) => { translatefile(urn); // how do i refetch data from here?
External state management with Apollo client?
I see a lot of people using redux and mobx with apollo client. however, after reading the docs it mentions that you perhaps do not need this:
Pass array from GraphQL query to React-Table
I am trying to take the array output of a graphql query and render it using react-table but i am getting a cannot read property 'foreach' of
React Apollo dynamically create query from state
Heres a model situation i have some fields in my db lets say color,size,height ... i can fetch and display these fields to user who can
Must contain a query definition
Iam new to react-native and appsync,graphql.we are trying to implement an appsync app using react-native when i tried to run its is throwing an
CORS blocks mutation in GraphQL Yoga
I am working here with a graphql prisma backend and a graphql yoga express server on top of that. in the frontend, i am trying to call a signout
How to combine two dependent GraphQL queries with 'compose'?
Solved! i'm trying to combine two dependent graphql queries. the first one should get an id and the second one should take that
Apollo Optimistic UI does not work in Mutation Component?
I am using <mutation /> component which has render prop api & trying to do optimistic response in the ui. so far i
Ad
How to trigger GraphQL Query from another React / ReactNative component
I have some problem. i have 2 component in react native. 1. (component a) for showing the data , this component use query
Setting state in the Query component of react-apollo
So, i'm trying to set an initial state for an edit component that gets data from the server and now should be editable in the component state. but
Why can't I add a Todo using Apollo Link State?
Todo never gets added. visibility filter works & remote coinbase fetch works. here's my repo 👇
What __typename should be in Apollo Link State?
In the todo example given in apollo link state docs it has a __typename property as follows - const newtodo = {
Apollo GraphQL requests are canceled
I am building a react type ahead text field component using downshift and react-apollo. as the user types i am querying
Implementing client side filtering with Apollo link state cache
Is it possible to query the apollo client cache to get a list of filtered data on the client? after the client fetches data from the
Upgrading React 16 App to Apollo 2 Issue
I have a react 16 app and i am just trying to upgrade to apollo2. near enough the same code works with apollo1. here is my
How to import GraphQL query?
I have my project setup to import .graphql files. that works fine. but my problem is i don't know how to define a query in a
Dispatch redux action after Apollo Query component returns result
Using the old way: graphql(get_projects_by_user_id, { options: ownprops => ({ skip: !ownprops.loggeduser.id,
GraphQL+React+Apollo:Unable to fetch data from server to client
When i query server with the following:-
Query works in GraphiQL but returns empty array in Actual Code while using React Apollo
I have a simple query like this import gql from "graphql-tag"; export const get_todos_by_product = gql` query
Ad
Automatic cache updates do not work in react apollo
The document says the
Error while wrapping a component in a graphql query
I'm using an apollo client to send request to a graphql server. so i wrapped a react component in a graphql function in this way
Destructure a Flow object type?
I'm generating flow types for apollo client, and i currently have this: type fetchmodulequery = {| // fetch single module
Handling success/error response messages in React Apollo
I'd like to have a success/error message displayed after mutations take place to inform the user that their mutation was/wasn't successful.
Displaying Data on select option between components on React using graphql
So basically im struggling to understand what my next step needs to be. in productlist.js have a simple select
Apollo boost trigger refetch outside of component
I'm playing around with apollo's new
How to pass an Id to a query that is not being called in the component during refetchQuery in apollo/graphql/react
I am trying to fetch a query that needs an id to be passed to it. however i am not calling the query in the component. i tried
API Error: Error: connect ECONNREFUSED 127.0.0.1:389 Apollo-React MongoDB
I am trying to run a api service with apollo(graphql), react, webpack and mongodb on windows environment . the service starts success, but when i
Apollo/graphQL: How to use optimistic UI for a mutation of a nested react component?
As shown below i'm getting my data in my nextjs application in the pages/article.js using a graphql query. this data is passed down
GraphQL error: Internal server error when accessing graphQL
I am using graphql with wpgraphql inside a wp setup. i have been using the service without any problems until i updated a custom post
React - Apollo Client, How to add query results to the state
I've created a react app driven by apollo client and graphql. my schema is defined so the expected result is an array of objects
Ad
Handling Apollo errors on the component side
Question how can i react to apollo errors in my components? i'd like for example to display a red banner if a
How to use data from readFragment in Apollo?
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).
Ad
Blog Categories
Ad