Add GraphQL Extensions (#184)
This enables accessing the Extensions field, as defined in the response format: https://spec.graphql.org/October2021/#sec-Response-Format Extensions can be enabled using configuration option use_extensions. This will change the return parameters of the generated client functions. Making it a breaking change if enabled. Since extensions are untyped as defined in the spec, the Client will return an interface of type map[string]interface{}.
This commit is contained in:
+22
-17
@@ -227,20 +227,9 @@ func OmitEmptyQuery(
|
||||
tz string,
|
||||
tzNoOmitEmpty string,
|
||||
) (*OmitEmptyQueryResponse, error) {
|
||||
__input := __OmitEmptyQueryInput{
|
||||
Query: query,
|
||||
Queries: queries,
|
||||
Dt: dt,
|
||||
Tz: tz,
|
||||
TzNoOmitEmpty: tzNoOmitEmpty,
|
||||
}
|
||||
var err error
|
||||
|
||||
var retval OmitEmptyQueryResponse
|
||||
err = client.MakeRequest(
|
||||
nil,
|
||||
"OmitEmptyQuery",
|
||||
`
|
||||
req := &graphql.Request{
|
||||
OpName: "OmitEmptyQuery",
|
||||
Query: `
|
||||
query OmitEmptyQuery ($query: UserQueryInput, $queries: [UserQueryInput], $dt: DateTime, $tz: String, $tzNoOmitEmpty: String) {
|
||||
user(query: $query) {
|
||||
id
|
||||
@@ -252,9 +241,25 @@ query OmitEmptyQuery ($query: UserQueryInput, $queries: [UserQueryInput], $dt: D
|
||||
convert2: maybeConvert(dt: $dt, tz: $tzNoOmitEmpty)
|
||||
}
|
||||
`,
|
||||
&retval,
|
||||
&__input,
|
||||
Variables: &__OmitEmptyQueryInput{
|
||||
Query: query,
|
||||
Queries: queries,
|
||||
Dt: dt,
|
||||
Tz: tz,
|
||||
TzNoOmitEmpty: tzNoOmitEmpty,
|
||||
},
|
||||
}
|
||||
var err error
|
||||
|
||||
var data OmitEmptyQueryResponse
|
||||
resp := &graphql.Response{Data: &data}
|
||||
|
||||
err = client.MakeRequest(
|
||||
nil,
|
||||
req,
|
||||
resp,
|
||||
)
|
||||
return &retval, err
|
||||
|
||||
return &data, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user