graphql / graphql/graphql-spec

Allow empty object type _extensions_ in schema

Open
#1,106 10 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.6k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I have been told by @martinbonnin that the following [isn't supposed to work according to the spec](https://github.com/apollographql/apollo-kotlin/issues/6061#issuecomment-2238863219):

```
extend type Query {

}

extend type Mutation {

}
```

However being able to have empty type definitions is useful sometimes where a local "stub" schema needs to be changed between empty and non-empty frequently as part of the dev workflow.

Specifically the use case for us is that we have a local `stub.graphqls` schema alongside the remote schema we download from the backend. Our devs sometimes add types to the `stubs.graphqls` while waiting for the changes to be deployed to the real schema (we try to avoid manually tempering the real schema). So about half of the time the content of the `extend type Query` is empty.

A similar use case can be found [here](https://stackoverflow.com/questions/68356207/how-to-define-an-empty-object-type-in-a-graphql-schema).

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.