graphql icon indicating copy to clipboard operation
graphql copied to clipboard

`{extensions}`: Improve `Extension` interface methods naming.

Open chris-ramon opened this issue 10 months ago • 1 comments

Actual

Currently the extensions component defined in:

https://github.com/graphql-go/graphql/blob/58689e0742f217137ac0c82b16e2d658e0cc1853/extensions.go#L32-L33

Contains methods that are named in a way that could be clearer, for example:

https://github.com/graphql-go/graphql/blob/58689e0742f217137ac0c82b16e2d658e0cc1853/extensions.go#L40-L41

^ It is not clear if the hook executes before or after the Parse process started.

Expected

We want to update the Extensions interface methods to a clearer naming using precise prefix, eg:

ParseDidStart -> BeforeParseHook

Using the same re-naming strategy: Before/After<Component Name>Hook we want to update the other methods.

For backwards compatibility let's keep the existing methods as a fallback.

Notes

  • This naming improvement was found while working in a University Thesis via the following PR: https://github.com/chris-ramon/thesis-graphql-go/pull/66

chris-ramon avatar Jun 12 '25 18:06 chris-ramon

If you would like me to solve this issue, either tag me in a comment or check this box:

  • [ ] Solve Issue

You can disable automatic comments on my settings page

mentatbot[bot] avatar Jun 12 '25 18:06 mentatbot[bot]