8000 `{extensions}`: Improve `Extension` interface methods naming. · Issue #721 · graphql-go/graphql · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
{extensions}: Improve Extension interface methods naming. #721
Open
@chris-ramon

Description

@chris-ramon

Actual

Currently the extensions component defined in:

graphql/extensions.go

Lines 32 to 33 in 58689e0

// Extension is an interface for extensions in graphql
type Extension interface {

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

graphql/extensions.go

Lines 40 to 41 in 58689e0

// ParseDidStart is being called before starting the parse
ParseDidStart(context.Context) (context.Context, ParseFinishFunc)

^ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0