mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-10-20 06:28:13 +00:00
Add 'unnamed' for the operations without the name.
This commit is contained in:
+5
-1
@@ -34,7 +34,11 @@ func parseGraphQLQuery(c *fiber.Ctx) (operationType, operationName string, cache
|
|||||||
for _, d := range p.Definitions {
|
for _, d := range p.Definitions {
|
||||||
if oper, ok := d.(*ast.OperationDefinition); ok {
|
if oper, ok := d.(*ast.OperationDefinition); ok {
|
||||||
operationType = oper.Operation
|
operationType = oper.Operation
|
||||||
operationName = oper.Name.Value
|
if oper.Name != nil {
|
||||||
|
operationName = oper.Name.Value
|
||||||
|
} else {
|
||||||
|
operationName = "undefined"
|
||||||
|
}
|
||||||
for _, dir := range oper.Directives {
|
for _, dir := range oper.Directives {
|
||||||
if dir.Name.Value == "cached" {
|
if dir.Name.Value == "cached" {
|
||||||
cacheRequest = true
|
cacheRequest = true
|
||||||
|
|||||||
Reference in New Issue
Block a user