diff --git a/graphql/graphql.go b/graphql/graphql.go index 7aa427b45..6417fc9ed 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -1217,6 +1217,9 @@ func (r *Resolver) Block(ctx context.Context, args struct { Number *Long Hash *common.Hash }) (*Block, error) { + if args.Number != nil && args.Hash != nil { + return nil, errors.New("only one of number or hash must be specified") + } var numberOrHash rpc.BlockNumberOrHash if args.Number != nil { if *args.Number < 0 {