youshido-php / GraphQL

Pure PHP realization of GraphQL protocol
MIT License
710 stars 107 forks source link

ASTField query, not its subqueries #241

Open keywinf opened 4 years ago

keywinf commented 4 years ago

Hi, thanks for this great repo.

I suggest we get the $ast itself up to the ResolveInfo, not its subfields ($astFields), since we could want to retrieve its location. Example : in a Resolve callback, of a specific field, we could check if user has sufficient rights to read the field, and if not nullify the value and add an error to the ExecutionContext with Location information inside the message (line, column).

I did a fork to get this working, but I'd love to hear about you on this.

Thanks

Jalle19 commented 4 years ago

Feel free to make a PR if you already have it coded up.