Skip to content

GraphQL Directives #578

Description

@marwan38

Description

Directives are a fundamental part of GraphQL and as such I believe should be part of the base providing of any GraphQL implementation. It should be fairly straight forward to add as it's not much different from adding a new type, or interface, etc. Happy to do it with a bit of guidance.

Additional context or points of discussion

I would not ask or bother with this feature were I able to access the GraphQL schema directly during schema build, but I haven't been able to achieve that as the schema instance is generated right before generating the schema (as far as I understood the source code). If we can expose the schema, I'd prefer doing that as it's much less work Adding a directive is as easy as:

<?php
use GraphQL\Type\Definition\Directive;

$directive = new Directive($config);
$graphqlSchema->directives[] = $directive;

That is all.

Validations

  • You intend to implement the feature yourself
  • You have read the contributing guide
  • You strongly believe this feature should be in core, rather than being its own community module
  • You have checked for existing issues or pull requests related to this feature (and didn't find any)

PRs

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions