graphql

miikka 2019-11-27T06:11:13.105600Z

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

miikka 2019-11-27T06:16:16.105900Z

I'm looking at what https://graphql.github.io/graphql-spec/June2018/#sec-Executing-Requests says about operations

hlship 2019-11-27T06:26:49.106200Z

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

hlship 2019-11-27T06:26:59.106500Z

queries are allowed to execute in any convienient order.

hlship 2019-11-27T06:27:16.107100Z

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

hlship 2019-11-27T06:27:29.107500Z

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

hlship 2019-11-27T06:27:35.107900Z

And subscriptions are entirely different.

miikka 2019-11-27T06:28:10.108100Z

yeah

orestis 2019-11-27T07:07:04.109100Z

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

domkm 2019-11-28T19:04:40.110900Z

There's nothing stopping you from doing that

domkm 2019-11-28T19:05:40.111100Z

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

hlship 2019-11-28T21:39:20.111300Z

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

hlship 2019-11-28T21:41:14.111700Z

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

domkm 2019-11-28T21:41:28.111900Z

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

orestis 2019-11-29T06:48:03.112600Z

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

gklijs 2019-11-29T10:03:38.112800Z

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