Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
823 views
in Technique[技术] by (71.8m points)

How to add resolvers to apollo/client and local feilds to be add to graphql Query

I'm doing new project with apollo/client, how to use Apollo Client for React and how to manage local state using the cache. From the docs, it's as simple as writing to the cache using cache.writeData and reading from it using a simple query.

Adding local fields to query : following @client followingID @client (Got this warning Found @client directives in a query but no ApolloClient resolvers were specified. This means ApolloClient local resolver handling has been disabled, and @client directives will be passed through to your link chain)

I am not getting data from server also.

`Error! $GraphQL error: Validation error of type FieldUndefined: Field 'following' in type 'Celeb' is undefined @ 'xxx/xx/user/following' GraphQL error: Validation error of type UnknownDirective: Unknown directive client @ 'xxx/xx/user/following' GraphQL error: Validation error of type FieldUndefined: Field 'followingID' in type 'Celeb' is undefined @ 'xxx/xx/user/followingID' GraphQL error: Validation error of type UnknownDirective: Unknown directive client @ 'xxx/xx/user/followingID


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...