graphql

2020-07-24T20:11:38.250200Z

Am I correct in concluding that if you migrated to lacinia.pedestal2, that the query extraction no longer calls the extract-query multimethod for query extraction? We were extending that to parse queries sent in multipart requests (graphql upload spec)

2020-07-24T20:25:40.251100Z

(I don’t want to be that guy always complaining, still loving the library. I will offer pull requests when applicable 🙂 )

2020-07-24T21:16:42.253800Z

In other questions: Could it be that enum transformers are not called to serialize default values? When I add a custom scalar, say a Decimal, I can put a decimal literal in my schema.edn as a default-value, and in introspection, this default value will have been serialized by my custom scalar serialize function. Now, with enums, I have an enum transformer that adds a namespace/kebab-cases the constant. Now, I expected to be able to add a ns-qualified kebab-cased keyword in schema.edn as a default-value, and, in introspection, get my serialize function called for this enum. This, however, appears to not be the case and instead I just get (name enum-member) in defaultValue of an introspection query. That trips up GraphQL playground, as a kebab-cased string is not a member of that enum ^^

hlship 2020-07-25T18:12:58.256100Z

Well, thanks! That’s high praise.

2020-07-24T21:18:17.253900Z

Again, don’t want to be a burden. I am willing to provide issues, patches, or whatever to contribute 🙂. My reasoning: rather report a false positive, than not report a legit bug 🙂.

hlship 2020-07-24T21:22:08.254100Z

Yes, the new namespace is simpler, and does less. You can swap in some of the old interceptors however, or mix and match pretty easily.

hlship 2020-07-24T21:23:27.254300Z

This does sound like a bug to me.

2020-07-24T21:24:43.254500Z

Sanity check: The expected behaviour is that you put a ‘parsed’ enum value as default-value in schema.edn?

2020-07-24T21:25:08.254700Z

So in this case, a ns-qualified kebab-cased keyword

2020-07-24T21:30:40.254900Z

Right, so that means replacing both interceptors. That sounds fair, we were already replacing body-data to deal with multipart requests, so I guess we’ll also replace the graphql-data interceptor with the old / a custom implementation when this library is used with pedestal2 interceptors

2020-07-24T21:31:52.255100Z

Extending that multimethod was a nice sneaky solution while it lasted, but I can see your reasoning of not wanting two extension methods (replacement of interceptors and extending of multimethods)

2020-07-24T21:33:14.255300Z

If so, I can take a stab at it

2020-07-24T22:49:08.255500Z

Created a fix: https://github.com/walmartlabs/lacinia/pull/331

2020-07-24T23:00:10.255800Z

I have to say, it is quite easy to trace and fix problems in lacinia as a relative outsider 🙂.