-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Document file upload handling for GraphQL #913
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
Conversation
I'm not sure if we should split this whole "page" between REST and GraphQL, as to not mix them in the resource annotation, and then having to cover both for every step of the process. |
Also the EventSubscriber for setting the resolved URL will not work with GraphQL, but I think we can fix that separately, by just replacing the whole thing with a custom normalizer (that should work for both REST and GraphQL, right?). (see #916) |
Thank you for working on this @lukasluecke! |
|
||
final class CreateMediaObjectResolver implements MutationResolverInterface | ||
{ | ||
public function __invoke($item, array $context): MediaObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @param
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment below - it's the same as the existing REST example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The REST __invoke
doesn't need a PHPDoc (since it's already typehinted), but it's useful here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, makes sense. We do not use the $item here, but I'll describe that as well 👍
@alanpoulain Should I split it into a separate page as part of this PR, or do we want to handle that afterwards? So we‘d just add a „Handling File Upload“ page under the GraphQL section? And maybe add a link in the „original“ for discoverability? |
The GraphQL page is rapidly growing, so I was thinking of splitting it into multiple pages, but it will probably be done after #884 (\cc @bpolaszek). In the meantime, you should add a section In the future, it will be great to have the same page for all the possible configurations (REST/GraphQL/ORM/MongoDB ODM) with some selectors like the selector for the version, but it's a lot of work... |
Any update on this @lukasluecke? |
@alanpoulain Will try to finish this tomorrow 🙂 |
@lukasluecke I can take this over if you're okay with it. |
Closed in favor of: #973. |
This should cover what's needed to use file uploads with a GraphQL API (and with a link to a client implementation for Apollo).