graphql

mafcocinco 2020-05-18T02:18:36.107400Z

Any suggestions/best practices for how to organize a GraphQL server project that uses lacinia? Specifically, I’m thinking about how to layout the directory structure of the project WRT to objects, queries, mutations, etc. We have made a couple of different attempts, none of which I am particularly happy with.

gklijs 2020-05-18T11:40:52.108400Z

I put the functionally related ones with each other as 'services' https://github.com/openweb-nl/kafka-graphql-examples/tree/master/graphql-endpoint/src/nl/openweb/graphql_endpoint. Not sure that works better,

steveb8n 2020-05-18T02:19:25.108200Z

Q: how can I specify an optional list of string argument type?

{:type (list String)}
is parsed as a required/non-null arg. I can workaround this with an input type but that adds some nesting in the client i.e. complexity

hlship 2020-05-18T16:13:57.108600Z

That should not be the case; (list String) is an optional type, even in a field argument. Can you provide a short example of this occurring?

steveb8n 2020-05-21T07:16:50.109700Z

@hlship how right you are. I discovered it here https://gist.github.com/stevebuik/e289d6783b43639726cbc39357728bbf that my problem was not in the schema but in the client GQL mutation. nothing like having to document a question, only to find the answer. sorry for the distraction

hlship 2020-05-21T15:50:17.109900Z

Glad to be your :duckie: