drupal-graphql / drupal-graphql/graphql

Require `*Definition` methods to return `\GraphQL\Language\Source|NULL`

Open
#1,367 0 comments 0 reactions 0 assignees View on GitHub
5.x
Dominant language
PHP
Stars
287
Forks
198
PR merge metrics
No merged PRs in 30d

Description

We currently allow returning `string|NULL` from methods such as `getSchemaDefinition` and `getExtensionDefinition`. However, that does not allow providing location information which is very useful in debugging.

To ensure SDL can always be traced back to its origins we should force plugins to return a `Source` instance. The only required value for `Source` is the actual string, but it's very easy to provide a name such as "Automatically Generated by {plugin ID}".

Since this is a change of return type for something that's implemented in user land it's a breaking change and can only be done in 5.x.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.