Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register directives via schema config #947

Merged
merged 2 commits into from
Jan 6, 2023

Conversation

sforward
Copy link
Contributor

Summary

With this PR you could register directives. This opens the option to explore the possibilities of directives.

Do you want me to add this to the readme? Subscriptions can be registered the same way, but aren't mentioned in de readme.


Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Misc. change (internal, infrastructure, maintenance, etc.)

Checklist:

  • Existing tests have been adapted and/or new tests have been added
  • Add a CHANGELOG.md entry
  • Update the README.md
  • Code style has been fixed via composer fix-style

@sforward sforward force-pushed the feat/register-directives branch from b9dccb9 to b977ebf Compare September 26, 2022 07:28
@mfn
Copy link
Collaborator

mfn commented Sep 26, 2022

We had multiple attempts in the past ( #703 , #860 ).

What is the end goal here? I think I'd be more confident knowing where this goes, as there were reasons why the previous approaches didn't pan out.

@sforward
Copy link
Contributor Author

My previous attempt was more focussed on a general support for directives. The current PR makes it just possible to register directives to the schema, so anyone can add specific functionality via a custom directive.

For example, I was attempting an execution middleware that checks for a directive on the query level to apply some specific caching. But also directives on the field level like added to the tests in #860 could be implemented with this PR, if someone needs it in an application.

@mfn
Copy link
Collaborator

mfn commented Sep 26, 2022

Would it be possible to provide a small / non-useless directive as an example, which we then further could also use in a test?

Do you want me to add this to the readme?

If we can make the above work, I'd be for this!

@sforward
Copy link
Contributor Author

I've added a test for the directive registration. It includes an example directive with all available options.

Copy link
Collaborator

@mfn mfn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@mfn mfn merged commit 1d31ee0 into rebing:master Jan 6, 2023
@sforward sforward deleted the feat/register-directives branch March 6, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants