api-platform / api-platform/core

[GraphQL] Use same type for mutations and queries if normalization context is equal

Open
#4,102 2 comments 0 reactions 0 assignees View on GitHub
GraphQL
Dominant language
PHP
Stars
2.6k
Forks
980
Avg merge
2d 5h
Merged PRs (30d)
48

Description

**Description**

[https://api-platform.com/docs/core/graphql/#different-types-when-using-different-serialization-groups](https://api-platform.com/docs/core/graphql/#different-types-when-using-different-serialization-groups)

In your documentation it states that if the normalization context is the same, then the generated type will be equal. However, looking at the TypeBuilder's code this appears to only be the case for collection_query and item_query. It would be nice if this was also the case for mutations and even custom mutations, because otherwise certain features of popular clients like Apollo don't work as expected (e.g. caching).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.