graphql-go / graphql-go/graphql

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

Open
#721 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

#### 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/AfterHook` 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

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.