apollo-client Questions

2

the enum define in OrderTypesEnum.gql enum OrderTypes { full_buy pink_buy } import OrderTypesEnum.gql file import OrderTypes from '@/graphql/OrderTypesEnum.gql'` but, How to get enum in co...
Uta asked 18/9, 2019 at 17:42

0

Kotlin Android app using graphQl & ApolloClient. I want to test this method: fun myMethod(id: String): Single<List<MyEntity>> { val call = Query(id) return Rx2Apollo.from(apolloCl...
Foxglove asked 29/9, 2020 at 9:59

1

Solved

I am trying to build a simple function inside a class that returns an Apollo Client. Here is my code: import appConfig from 'config/app-config'; import { ApolloClient, InMemoryCache, createHttpLink...
Math asked 28/9, 2020 at 0:12

1

Solved

I am wondering if there is a way to expire cached items after a certain time period, e.g., 24 hours. I know that Apollo Client v3 provides methods such as cache.evict and cache.gc which are a good ...

1

I am trying to access a react context values within the setContext function for my Apollo client. I would like to be able to dynamically update the header for each graphql request with the react co...
Delsiedelsman asked 8/12, 2019 at 3:11

1

Solved

This is the first time I've ventured into fragments and I can't see where I'm screwing up, but it definitely isn't working! In GraphiQL it's working fine: query Tasks($taskIds: [String]!) { tasks(...
Bahadur asked 11/8, 2020 at 16:29

2

Solved

Following the Apollo Angular docs, I applied this configuration to connect to a given graphql endpoint: import { HttpClientModule } from "@angular/common/http"; import { ApolloModule, APOLLO_OPTIO...
Fernandofernas asked 19/5, 2019 at 22:25

1

Solved

So using dataIdFromObject as the following: cache: new InMemoryCache({ dataIdFromObject: object => { switch (object.__typename) { case 'AppKey': return object.appKeyId case 'App': return o...
Paneling asked 4/7, 2020 at 15:58

3

Solved

I'm trying to get useQuery hook to work with TypeScript. Here is my query export const FETCH_LINKS = gql` query FetchLinks { feed { links { id createdAt url description } } } `; I generat...
Placebo asked 29/6, 2020 at 8:19

4

Solved

My frontend is localhost:3000, and my GraphQL server is localhost:3333. I've used react-apollo to query/mutate in JSX land, but haven't made a query/mutation from Express yet. I'd like to make th...
Valor asked 6/2, 2019 at 18:5

1

I have frontend client running on custom Next.js server that is fetching data with apollo client. My backend is graphql-yoga with prisma utilizing express-session. I have problem with picking corr...

6

Solved

I am attempting to use an Apollo Client on a node.js server to interface with another GraphQL API using the following code: import fetch from 'node-fetch' import { createHttpLink } from 'apollo-li...
Octennial asked 4/6, 2018 at 21:25

4

I'm building an app with VueJS and I'm using Apollo client to fetch data from a database through a GrapgQL server. I have code that looks like this: apollo.query({ query, variables }) // cont...
Robbinrobbins asked 15/7, 2017 at 21:20

1

So I am doing a MARN stack using MongoDB, Apollo, React Native (Expo) and Node I am stuck trying to figure out how to upload an array of object. i.e A post with an array of shots It is all workin...
Chadbourne asked 31/5, 2020 at 9:10

1

Solved

How to update the cache, after creating new data? Error message from Apollo Store error: the application attempted to write an object with no provided id but the store already contains an id of Use...
Spanos asked 26/5, 2020 at 17:43

3

Solved

I have a fairly simple node app using AWS AppSync. I am able to run queries and mutations successfully but I've recently found that if I run a query twice I get the same response - even when I know...
Blessington asked 12/7, 2018 at 13:28

2

I try to use ApolloClient 2.1 with the new Mutation Component. Simple use cases are working but now I have something more complex. What I want to achieve is to query data and put them in a list...
Sufi asked 4/5, 2018 at 14:57

4

Code for request: export class LogInContainer extends Component { submit = (values) => { const { mutate } = this.props; mutate({ variables: { email: values.email, password: values.passwo...
Year asked 20/5, 2020 at 19:7

1

Solved

I want to use some fragment: import {gql} from "apollo-boost"; import "../fragments/cardFragments.graphql" export const ADD_CARD = gql` mutation AddCard { createCard(input: { private: true, ...
Rectrix asked 21/5, 2020 at 17:38

1

Solved

I haven't been able to find a way to do this at all. Does anyone know if this is supported? Thanks.

1

Solved

Background We are working on a fairly large Apollo project. A very simplified version of our api looks like this: type Operation { foo: String activity: Activity } type Activity { bar: String...
Lassa asked 1/11, 2017 at 14:10

1

Solved

Testing the useSubscription hook I'm finding a bit difficult, since the method is omitted/not documented on the Apollo docs (at time of writing). Presumably, it should be mocked using the <Mocke...
Domingodominguez asked 29/4, 2020 at 14:39

1

Solved

Apollo client's codegen adds | null in the generated types, and I don't understand why they are there and how to get rid of them. I see no reason why the API would return an array of null, so I do...
Lubricant asked 10/5, 2020 at 9:23

0

I am writing to the cache with the update function after a mutation using Apollo Client. The cache contains the obj as shown below, and it is working properly. However, I can't find the right way ...

3

Solved

I'm trying to migrate from Redux Store to use Apollo Client Cache that comes with Apollo Graphql Client. One of the key features that sets Apollo Client apart from other data management solutions...
Geometric asked 24/1, 2020 at 6:22

© 2022 - 2024 — McMap. All rights reserved.