You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.
You're question is a bit light on the surrounding context, but I'll give it a shot:
$root refers to the "parent" type; it's empty if there's none. For example you query { user { orders { … you can access user from your orders resolve()
$args are the arguments passed to the node, e.g. user(arg1: value1)
$fields is ... I don't know where you got this from exactly, it's supposed to be the $context. The default Folklore context is the authenticated user but you can override it to be anything
$info is directly from http://webonyx.github.io/ to access the current node (AST?) tree to extract (look ahead) further information
I rarely do need $root, $args is a no-brainer, $context is very important (authentication) and for complex optimizations I need to access $info (via \GraphQL\Type\Definition\ResolveInfo::getFieldSelection)
If you're new to the whole GraphQL world I recommend getting acquainted with the architecture in general => http://facebook.github.io/graphql/
HTH
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What does the parameters of resolve($root, $args, SelectFields $fields, ResolveInfo $info) method mean?
as follow:
1、$root
2、$args
3、SelectFields $fields
4、ResolveInfo $info
The text was updated successfully, but these errors were encountered: