CreateDefaultContext() public static méthode

public static CreateDefaultContext ( ) : GraphQL
Résultat GraphQL
        public void TypeDirectFields()
        {
            var gql     = MemContext.CreateDefaultContext();
            var results = gql.ExecuteQuery("{ __type(name: \"User\") { name, description, kind } }");

            Test.DeepEquals(results, "{ __type: { name: 'User', description: '', kind: 'OBJECT' } }");
        }
        public void EnumTypeDirectFields()
        {
            var gql     = MemContext.CreateDefaultContext();
            var results = gql.ExecuteQuery("{ __type(name: \"AccountType\") { name, description, kind } }");

            Test.DeepEquals(results, "{ __type: { name: 'AccountType', description: null, kind: 'ENUM' } }");
        }
        public void SchemaTypes()
        {
            // TODO: Use Test.DeepEquals once we get all the primitive type noise sorted out

            var gql    = MemContext.CreateDefaultContext();
            var schema = (IDictionary <string, object>)gql.ExecuteQuery("{ __schema { types { name, kind, interfaces { name } } } }")["__schema"];
            var types  = (List <IDictionary <string, object> >)schema["types"];

            var intType = types.First(t => (string)t["name"] == "Int");

            Assert.AreEqual(intType["name"], "Int");
            Assert.AreEqual(intType["kind"].ToString(), "SCALAR");
            Assert.IsNull(intType["interfaces"]);

            var userType = types.First(t => (string)t["name"] == "User");

            Assert.AreEqual(userType["name"], "User");
            Assert.AreEqual(userType["kind"].ToString(), "OBJECT");
            Assert.AreEqual(((List <IDictionary <string, object> >)userType["interfaces"]).Count, 0);
        }
        public void ChildFieldType()
        {
            var gql     = MemContext.CreateDefaultContext();
            var results = gql.ExecuteQuery("{ __type(name: \"User\") { fields { name, type { name, kind, ofType { name, kind } } } } }");

            Test.DeepEquals(results,
                            @"{
                      __type: {
                          fields: [
                              { name: 'id', type: { name: null, kind: 'NON_NULL', ofType: { name: 'Int', kind: 'SCALAR' } } },
                              { name: 'name', type: { name: 'String', kind: 'SCALAR', ofType: null } },
                              { name: 'account', type: { name: 'Account', kind: 'OBJECT', ofType: null } },
                              { name: 'nullRef', type: { name: 'NullRef', kind: 'OBJECT', ofType: null } },
                             { name: 'total', type: { name: null, kind: 'NON_NULL', ofType: { name: 'Int', kind: 'SCALAR' } } },
                              { name: 'accountPaid', type: { name: null, kind: 'NON_NULL', ofType: { name: 'Boolean', kind: 'SCALAR' } } },
                              { name: 'abc', type: { name: 'String', kind: 'SCALAR', ofType: null } },
                              { name: 'sub', type: { name: 'Sub', kind: 'OBJECT', ofType: null } },
                              { name: '__typename', type: { name: 'String', kind: 'SCALAR', ofType: null } }
                          ]
                      }
                  }");
        }
        public void TypeWithChildFields()
        {
            var gql     = MemContext.CreateDefaultContext();
            var results = gql.ExecuteQuery("{ __type(name: \"User\") { fields { name } } }");

            Test.DeepEquals(results,
                            @"{
                      __type: {
                          fields: [
                              { name: 'id' },
                              { name: 'name' },
                              { name: 'account' },
                              { name: 'nullRef' },
                              { name: 'total' },
                              { name: 'accountPaid' },
                              { name: 'abc' },
                              { name: 'sub' },
                              { name: '__typename' }
                          ]
                      }
                  }");
        }
Exemple #6
0
 public static void StarWarsTypenameLukeHuman() =>
 StarWarsTests.TypenameLukeHuman(MemContext.CreateDefaultContext());
Exemple #7
0
 public static void StarWarsFragmentsInlineFragments() =>
 StarWarsTests.FragmentsInlineFragments(MemContext.CreateDefaultContext());
Exemple #8
0
 public static void StarWarsBasicQueryFetchLuke() =>
 StarWarsTests.BasicQueryFetchLuke(MemContext.CreateDefaultContext());
Exemple #9
0
 public static void StarWarsBasicQueryHero() =>
 StarWarsTests.BasicQueryHero(MemContext.CreateDefaultContext());
Exemple #10
0
 [Test] public void ByteArrayParameter() => GenericTests.ByteArrayParameter(MemContext.CreateDefaultContext());
Exemple #11
0
 [Test] public void GuidField() => GenericTests.GuidField(MemContext.CreateDefaultContext());
Exemple #12
0
 [Test] public void ListTypeIsList() => GenericTests.ListTypeIsList(MemContext.CreateDefaultContext());
Exemple #13
0
 [Test] public void CustomFieldSubQueryUsingContext() => GenericTests.CustomFieldSubQueryUsingContext(MemContext.CreateDefaultContext());
Exemple #14
0
 [Test] public void NoUserQueryReturnsNull() => GenericTests.NoUserQueryReturnsNull(MemContext.CreateDefaultContext());
Exemple #15
0
 [Test] public void AliasOneField() => GenericTests.AliasOneField(MemContext.CreateDefaultContext());
Exemple #16
0
 [Test] public void MutationWithReturn() => GenericTests.MutationWithReturn(MemContext.CreateDefaultContext());
Exemple #17
0
 [Test] public void NullPropagation() => GenericTests.NullPropagation(MemContext.CreateDefaultContext());
Exemple #18
0
 [Test] public void NestedEntityList() => GenericTests.NestedEntityList(MemContext.CreateDefaultContext());
Exemple #19
0
 [Test] public void GuidParameter() => GenericTests.GuidParameter(MemContext.CreateDefaultContext());
Exemple #20
0
 [Test] public void PostFieldSubQuery() => GenericTests.PostFieldSubQuery(MemContext.CreateDefaultContext());
Exemple #21
0
 [Test] public void ChildFieldWithParameters() => GenericTests.ChildFieldWithParameters(MemContext.CreateDefaultContext());
Exemple #22
0
 [Test] public void TypeName() => GenericTests.TypeName(MemContext.CreateDefaultContext());
Exemple #23
0
 public static void StarWarsBasicQueryHeroWithIdAndFriendsOfFriends() =>
 StarWarsTests.BasicQueryHeroWithFriendsOfFriends(MemContext.CreateDefaultContext());
Exemple #24
0
 [Test] public void DateTimeFilter() => GenericTests.DateTimeFilter(MemContext.CreateDefaultContext());
Exemple #25
0
 public static void StarWarsFragmentsAvoidDuplicatedContent() =>
 StarWarsTests.FragmentsAvoidDuplicatedContent(MemContext.CreateDefaultContext());
Exemple #26
0
 [Test] public void EnumerableSubField() => GenericTests.EnumerableSubField(MemContext.CreateDefaultContext());
Exemple #27
0
 public static void StarWarsTypenameR2Droid() =>
 StarWarsTests.TypenameR2Droid(MemContext.CreateDefaultContext());
Exemple #28
0
 [Test] public void EnumFieldQuery() => GenericTests.EnumFieldQuery(MemContext.CreateDefaultContext());
Exemple #29
0
 public static void StarWarsIntrospectionDroidTypeKind() =>
 StarWarsTests.IntrospectionDroidTypeKind(MemContext.CreateDefaultContext());
Exemple #30
0
 [Test] public void SimpleMutation() => GenericTests.SimpleMutation(MemContext.CreateDefaultContext());