mirror of
https://github.com/graphql-hive/console
synced 2026-05-23 17:18:23 +00:00
[hive/app] fix graphql error Must provide operation name if query contains multiple operations when query contain 2 operations (#5115)
Co-authored-by: Kamil Kisiela <kamil.kisiela@gmail.com>
This commit is contained in:
parent
d5173c1bd6
commit
f2da2aaf2f
1 changed files with 3 additions and 3 deletions
|
|
@ -21,6 +21,7 @@ const LabBody = z.object({
|
|||
required_error: 'Missing query',
|
||||
}),
|
||||
variables: z.record(z.unknown()).optional(),
|
||||
operationName: z.string().optional(),
|
||||
});
|
||||
|
||||
export function connectLab(server: FastifyInstance) {
|
||||
|
|
@ -110,14 +111,13 @@ export function connectLab(server: FastifyInstance) {
|
|||
document,
|
||||
variableValues: graphqlRequest.variables || {},
|
||||
contextValue: {},
|
||||
operationName: graphqlRequest.operationName,
|
||||
});
|
||||
|
||||
void res.status(200).send(result);
|
||||
} catch (e) {
|
||||
req.log.error(e);
|
||||
void res.status(200).send({
|
||||
errors: [e],
|
||||
});
|
||||
void res.status(200).send({ errors: [e] });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue