diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-05 15:12:12 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-05 15:12:12 +0000 |
commit | 8ec882085e734458ffe0fff8e2e4b72bc3871419 (patch) | |
tree | 6869bb67f3e66e9de828bc47a08577efa1e296c6 /doc/development/fe_guide/graphql.md | |
parent | f63850d9d6c3a81e78c93995c904ed6c0785ef19 (diff) | |
download | gitlab-ce-8ec882085e734458ffe0fff8e2e4b72bc3871419.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/fe_guide/graphql.md')
-rw-r--r-- | doc/development/fe_guide/graphql.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/development/fe_guide/graphql.md b/doc/development/fe_guide/graphql.md index 500e9dfe62a..0af45cb6887 100644 --- a/doc/development/fe_guide/graphql.md +++ b/doc/development/fe_guide/graphql.md @@ -2001,7 +2001,11 @@ relative to `app/graphql/queries` folder: for example, if we need a ### Mocked client returns empty objects instead of mock response -If your unit test is failing because response contains empty objects instead of mock data, you would need to add `__typename` field to the mocked response. This happens because mocked client (unlike the real one) does not populate the response with typenames and in some cases we need to do it manually so the client is able to recognize a GraphQL type. +If your unit test is failing because the response contains empty objects instead of mock data, add +`__typename` field to the mocked responses. + +Alternatively, [GraphQL query fixtures](../testing_guide/frontend_testing.md#graphql-query-fixtures) +automatically adds the `__typename` for you upon generation. ### Warning about losing cache data |