Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Resolver middleware#299

Merged
cniska merged 3 commits intomasterfrom
resolver-middleware
Oct 8, 2018
Merged

Resolver middleware#299
cniska merged 3 commits intomasterfrom
resolver-middleware

Conversation

@cniska
Copy link
Copy Markdown
Contributor

@cniska cniska commented Oct 8, 2018

Add support for resolver middleware.

This feature was inspired by graphql-middlware.

@cniska cniska added enhancement New feature or request refactor Related to refactoring schema Related to schema labels Oct 8, 2018
@cniska cniska added this to the Version 1.0 milestone Oct 8, 2018
@cniska cniska self-assigned this Oct 8, 2018
@cniska cniska requested review from Jalle19, q-hung and spawnia October 8, 2018 15:15
@cniska cniska mentioned this pull request Oct 8, 2018
@cniska cniska force-pushed the resolver-middleware branch 2 times, most recently from 8987fcc to 13a1124 Compare October 8, 2018 15:45
return $resolver->getResolveCallback();
}

if ($resolver instanceof \Closure) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

\is_callable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually correct.

@cniska cniska force-pushed the resolver-middleware branch from 13a1124 to e0c0140 Compare October 8, 2018 18:39
Copy link
Copy Markdown
Contributor

@Jalle19 Jalle19 left a comment

Choose a reason for hiding this comment

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

The code looks good, but some documentation would be great

@cniska cniska force-pushed the resolver-middleware branch 2 times, most recently from ed25b15 to a81f6f5 Compare October 8, 2018 19:44
Copy link
Copy Markdown
Contributor

@spawnia spawnia left a comment

Choose a reason for hiding this comment

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

Looks pretty clean, i like it!

Is there a way to specify non-global middleware?

Copy link
Copy Markdown
Contributor

@q-hung q-hung left a comment

Choose a reason for hiding this comment

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

👍 Is there any designed option for disabling middleware on a certain resolver?

@cniska cniska force-pushed the resolver-middleware branch from a81f6f5 to 0e639f4 Compare October 8, 2018 20:11
@cniska cniska merged commit 3acd24e into master Oct 8, 2018
@cniska cniska deleted the resolver-middleware branch October 8, 2018 20:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request refactor Related to refactoring schema Related to schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants