It's not a good idea to panic in GetOperationContext. Better to return an error here instead of panic: https://github.com/99designs/gqlgen/blob/b6d439505845b002132d3b050ec0a3a9def97045/graphql/context_operation.go#L66 Or just return a nil if the operation context is missing