lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Allow changing root type names

Open andershagbard opened this issue 2 years ago • 4 comments

  • [ ] Added or updated tests
  • [ ] Documented user facing changes
  • [ ] Updated CHANGELOG.md

This PR allows us to change the root type names.

I am not sure how it should be tested whether actually changing the values work?

Reference talk: https://lighthouse-php.slack.com/archives/CB28A070S/p1645698178486249

andershagbard avatar Mar 03 '22 11:03 andershagbard

We should use native SDL for changing the name of the root types, see http://spec.graphql.org/draft/#sec-Schema

spawnia avatar Mar 03 '22 11:03 spawnia

We should use native SDL for changing the name of the root types, see http://spec.graphql.org/draft/#sec-Schema

Might be a bit out of my knowledge for Lighthouse and GraphQL. Could use some help if anyone is up for it.

andershagbard avatar Mar 03 '22 11:03 andershagbard

It is not that hard. Basically, somewhere in the schema definition - probably schema.graphql - there can be a definition like this:

schema {
  subscription: CustomSubscription
}

This definition should be accessible in DocumentAST.

spawnia avatar Mar 03 '22 11:03 spawnia

Marked this as a draft, as the implementation is not based upon SDL yet.

I am not sure how it should be tested whether actually changing the values work?

This is going to become trivial, the test schema can simply include a schema { ... } definition with renamed root query types then.

spawnia avatar Mar 04 '22 08:03 spawnia