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)
Here in lacinia.pedestal
: https://github.com/walmartlabs/lacinia-pedestal/blob/92945c34486fc52916069963b6f87ee4e4dcbd58/src/com/walmartlabs/lacinia/pedestal.clj#L169
Here in lacinia.pedestal2
a block on content type being application/json
: https://github.com/walmartlabs/lacinia-pedestal/blob/92945c34486fc52916069963b6f87ee4e4dcbd58/src/com/walmartlabs/lacinia/pedestal2.clj#L49
And the new data interceptor not invoking an extendable multimethod: https://github.com/walmartlabs/lacinia-pedestal/blob/92945c34486fc52916069963b6f87ee4e4dcbd58/src/com/walmartlabs/lacinia/pedestal2.clj#L64
(I don’t want to be that guy always complaining, still loving the library. I will offer pull requests when applicable 🙂 )
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 ^^
Well, thanks! That’s high praise.
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 🙂.
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.
This does sound like a bug to me.
Sanity check: The expected behaviour is that you put a ‘parsed’ enum value as default-value in schema.edn?
So in this case, a ns-qualified kebab-cased keyword
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
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)
If so, I can take a stab at it
Created a fix: https://github.com/walmartlabs/lacinia/pull/331
I have to say, it is quite easy to trace and fix problems in lacinia as a relative outsider 🙂.