Skip to content

Commit

Permalink
Fixed Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Dec 12, 2022
1 parent 147a3c5 commit a2f64ad
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"message": "The GraphQL document has an execution depth of 6 which exceeds the max allowed execution depth of 3.",
"locations": [
{
"line": 2,
"column": 17
"line": 1,
"column": 1
}
],
"extensions": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
schema {
query: Query
mutation: Mutation
subscription: Subscription
}

interface Entity {
name: String!
}

type Mutation {
doSomething: String!
}

type Person implements Entity {
name: String!
address: String!
Expand All @@ -23,6 +29,10 @@ type SomeBook {
title: String
}

type Subscription {
onSomething: String!
}

enum CustomEnum {
ABC
DEF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"FieldMiddleware": "AllFields",
"EnableDirectiveIntrospection": false,
"DefaultDirectiveVisibility": "Public",
"AllowInlining": true,
"DefaultResolverStrategy": "Parallel",
"ValidatePipelineOrder": true,
"StrictRuntimeTypeValidation": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"FieldMiddleware": "UserDefinedFields",
"EnableDirectiveIntrospection": false,
"DefaultDirectiveVisibility": "Public",
"AllowInlining": true,
"DefaultResolverStrategy": "Parallel",
"ValidatePipelineOrder": true,
"StrictRuntimeTypeValidation": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"FieldMiddleware": "AllFields",
"EnableDirectiveIntrospection": true,
"DefaultDirectiveVisibility": "Public",
"AllowInlining": true,
"DefaultResolverStrategy": "Parallel",
"ValidatePipelineOrder": true,
"StrictRuntimeTypeValidation": false,
Expand Down
11 changes: 7 additions & 4 deletions src/HotChocolate/Core/test/Validation.Tests/ValidationUtils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HotChocolate.Language;
using HotChocolate.Types;
using HotChocolate.Validation.Types;
Expand All @@ -11,9 +12,11 @@ namespace HotChocolate.Validation;
public static class ValidationUtils
{
public static DocumentValidatorContext CreateContext(ISchema? schema = null)
{
return new() { Schema = schema ?? CreateSchema() };
}
=> new()
{
Schema = schema ?? CreateSchema(),
ContextData = new Dictionary<string, object?>()
};

public static void Prepare(this IDocumentValidatorContext context, DocumentNode document)
{
Expand Down Expand Up @@ -87,4 +90,4 @@ public static ISchema CreateSchema()
x => x.Repeatable())
.ModifyOptions(o => o.EnableOneOf = true)
.Create();
}
}

0 comments on commit a2f64ad

Please sign in to comment.