These are chat archives for graphql-java/graphql-java

15th
Jun 2017
Andreas Marek
@andimarek
Jun 15 2017 01:29
@bsideup please do, but I agree in general with @bbakerman : changing a fundamental constraint of graphql is not something I wanna do. The implications in the long term are unknown and we are having enough to do with the official spec. Adding complexity on top of that is something we should avoid.
Sergei Egorov
@bsideup
Jun 15 2017 06:12
I understand your concerns, yet I think that an option to relax (not break) the spec is something acceptable. At least it's waaay better than "dummy: String" member in each such interface I have to add to avoid the validation error :)
kavya-ithaka
@kavya-ithaka
Jun 15 2017 17:18
Hi there. I am a newcomer to GraphQL so please forgive the basic ness of my question. I'm trying to use an enum field as an argument to a query and it just doesn't work. Can't see the parsing error or find any examples that help.
def query = """ query HeroNameQuery { hero(episode:"NEWHOPE"){ name } } """ def expected = [ hero: [ name: 'R2-D2' ] ] Should this work? Returns null.
Bojan Tomić
@kaqqao
Jun 15 2017 17:43
No quotes around the enum value, that's the only trick
kavya-ithaka
@kavya-ithaka
Jun 15 2017 17:45
That worked! Thanks @kaqqao :)
Bojan Tomić
@kaqqao
Jun 15 2017 17:46
:) no worries
Sanchay Javeria
@javeria2
Jun 15 2017 20:43
Is it possible to query a list of objects in a single transaction?

Something like

someData(id = [3,4,6]) {
   someProperty
}

Or another way of accomplishing the same thing?

Bojan Tomić
@kaqqao
Jun 15 2017 20:55
@javeria2 yes, of course you can do that
Any query is allowed to accept or return a list of values
What you typed is a completely valid example
Sanchay Javeria
@javeria2
Jun 15 2017 20:56
Oh sweet! I didn't see in on the docs, unless I missed something.
Bojan Tomić
@kaqqao
Jun 15 2017 20:57
Now, if you had batching in mind i.e. fetching someProperty for all 3 objects in one go instead of 3 different calls to the resolver function, it's also doable but in a different way
Check out the tests using @Batched
If you need more help, I'll help you further when I get to a computer
Sanchay Javeria
@javeria2
Jun 15 2017 20:59
:thumbsup: :thumbsup:
Bojan Tomić
@kaqqao
Jun 15 2017 21:00
GraphQLList is both an input and output type, so you can accept or return a list from queries