apollographql / apollographql/apollo-feature-requests

Return local-only fields in mutation responses

Open
#331 0 comments 1 reaction 0 assignees View on GitHub
core
Dominant language
No language data
Stars
132
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Currently it seems [local-only](https://www.apollographql.com/docs/react/local-state/managing-state-with-field-policies) fields do not return in mutation responses.

To elaborate I have a query that returns type FooType and that same type is returned in the create mutation. I have a local only field applied on that type which correctly returns in query responses but not mutation responses.

Since the local only field is tied directly to the type it seems counter intuitive that it doesnt return in all cases of using that type.

It is possible to enhance apollo to allow this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported case with a query and create mutation returning FooType, including its local-only field, and compare the two responses. Trace how Apollo handles the local-only field for query versus mutation results. Done means the field is returned consistently in mutation responses as it is in query responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.