Fork me on GitHub
#graphql
<
2019-11-27
>
miikka06:11:13

@dominicm Can you find me the part of spec where it says so?

hlship06:11:49

The spec is about not mixing and matching queries, mutations, and subscriptions.

hlship06:11:59

queries are allowed to execute in any convienient order.

hlship06:11:16

mutations must execute sequentially; the first mutation must fully complete before the second mutation is executed.

hlship06:11:29

That's fundamentally the only difference between queries and mutations.

hlship06:11:35

And subscriptions are entirely different.

orestis07:11:04

Wait, can I send two queries in one HTTP request to Lacinia, and I get two answers in one response?

domkm19:11:40

There's nothing stopping you from doing that

domkm19:11:40

lacinia-pedestal might not have that built in but it seems easy enough to check whether the request is an object or an array of objects

hlship21:11:20

query {
  customer(id: 12345) { name }
  order(id: "12345") { date }
}
A single query can hit multiple query operations at the same time.

hlship21:11:14

{"data": {"customer": "fred", "order": "20191128"}}

domkm21:11:28

Yeah, good point. I assumed he was referring to Apollo's query batching but perhaps not

orestis06:11:03

Thanks, yeah I was referring to what people wrote above :) very cool

gklijs10:11:38

You could even do multiple similar queries if you use aliases.