Skip to content

Set default value for contextValue #365

@mattkrick

Description

@mattkrick

Following up from #326 (comment) often times it does make sense that the contextValue is an object. This is because in addition to an authToken, you might have another token (resetPasswordToken, verifyEmailToken, etc) or even something like a socket for subscriptions. However, if you don't need any of those things, it's still nice to call graphql(Schema, query) instead of graphql(Schema, query, null, {}). To keep it that way, execute should default the value to an object here: https://github.com/graphql/graphql-js/blob/master/src/execution/execute.js#L115

Thoughts?

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