mirror of
https://github.com/graphql-hive/console
synced 2026-05-24 09:38:26 +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',
|
required_error: 'Missing query',
|
||||||
}),
|
}),
|
||||||
variables: z.record(z.unknown()).optional(),
|
variables: z.record(z.unknown()).optional(),
|
||||||
|
operationName: z.string().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function connectLab(server: FastifyInstance) {
|
export function connectLab(server: FastifyInstance) {
|
||||||
|
|
@ -110,14 +111,13 @@ export function connectLab(server: FastifyInstance) {
|
||||||
document,
|
document,
|
||||||
variableValues: graphqlRequest.variables || {},
|
variableValues: graphqlRequest.variables || {},
|
||||||
contextValue: {},
|
contextValue: {},
|
||||||
|
operationName: graphqlRequest.operationName,
|
||||||
});
|
});
|
||||||
|
|
||||||
void res.status(200).send(result);
|
void res.status(200).send(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
req.log.error(e);
|
req.log.error(e);
|
||||||
void res.status(200).send({
|
void res.status(200).send({ errors: [e] });
|
||||||
errors: [e],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue