graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.87k stars 839 forks source link

[question] how to get argument in nested quey #556

Closed cacing69 closed 3 years ago

cacing69 commented 4 years ago

according to graphql pagination example, i want to create a simmiliar query like this https://graphql.org/learn/pagination/

image

i can get username arg on top level but, how to get arg last in log query

cacing69 commented 4 years ago

image for temporary i used this method to get args if someone know how to get with a simple ways, pls tell me.

on next i will make this recursive where they will get all args deeper image image

bhoriuchi commented 4 years ago

I wrote a library that will make working with and defining custom directives easier https://github.com/bhoriuchi/graphql-go-tools

The example shows how to define and use a directive. The args will be provided to the directive handler function as a map[string]interface{}

Other than that the only change to your workaround approach i would make is to define a recursive function in the event your argument is a complex type.