shurcooL / graphql

Package graphql provides a GraphQL client implementation.
MIT License
705 stars 282 forks source link

Multiline graphql tag #21

Open alexander-myltsev opened 6 years ago

alexander-myltsev commented 6 years ago

I have a very long graphql tag as follows:

`graphql:"nameResolver(names: $names, advancedResolution: $advancedResolution, bestMatchOnly: true, preferredDataSourceIds: [1,12,169])"`

Is there a way to split it to multilines as follows?:

graphql:"nameResolver(names: $names, 
                      advancedResolution: $advancedResolution, 
                      bestMatchOnly: true, 
                      preferredDataSourceIds: [1,12,169])"`
dmitshur commented 6 years ago

To answer your question, this library uses the standard Go struct field tags (as documented at https://godoc.org/reflect#StructTag), and they don’t support multiple lines. See issue golang/go#15893. That means, at this time, this isn’t possible.

We can use this issue for further discussion.