[Test] public static void InlineFragementWithListField() => GenericTests.InlineFragementWithListField(MemContext.CreateDefaultContext());
Esempio n. 2
0
 [Test] public void CustomFieldSubQueryUsingContext() => GenericTests.CustomFieldSubQueryUsingContext(MemContext.CreateDefaultContext());
        public void FieldArgsQuery()
        {
            var gql     = MemContext.CreateDefaultContext();
            var results = gql.ExecuteQuery(
                "query SchemaQuery { __schema { queryType {... TypeFragment }, mutationType {... TypeFragment } } }, fragment TypeFragment on __Type { fields { name, args { name, description, type { name, kind, ofType { name, kind } }, defaultValue } } }");

            Test.DeepEquals(
                results,
                @"{ 
                    ""__schema"": {
                        ""queryType"": {
                          ""fields"": [
                            {
                              ""name"": ""users"",
                              ""args"": []
                            },
                            {
                              ""name"": ""user"",
                              ""args"": [
                                {
                                  ""name"": ""id"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""Int"",
                                      ""kind"": ""SCALAR""
                                    }
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""account"",
                              ""args"": [
                                {
                                  ""name"": ""id"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""Int"",
                                      ""kind"": ""SCALAR""
                                    }
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""accountPaidBy"",
                              ""args"": [
                                {
                                  ""name"": ""paid"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": ""DateTime"",
                                    ""kind"": ""INPUT_OBJECT"",
                                    ""ofType"": null
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""accountsByGuid"",
                              ""args"": [
                                {
                                  ""name"": ""guid"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""Guid"",
                                      ""kind"": ""SCALAR""
                                    }
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""accountsByType"",
                              ""args"": [
                                {
                                  ""name"": ""accountType"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""AccountType"",
                                      ""kind"": ""ENUM""
                                    }
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""mutateMes"",
                              ""args"": [
                                {
                                  ""name"": ""id"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""Int"",
                                      ""kind"": ""SCALAR""
                                    }
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""hero"",
                              ""args"": [
                                {
                                  ""name"": ""episode"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""EpisodeEnum"",
                                      ""kind"": ""ENUM""
                                    }
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""human"",
                              ""args"": [
                                {
                                  ""name"": ""id"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": ""String"",
                                    ""kind"": ""SCALAR"",
                                    ""ofType"": null
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""droid"",
                              ""args"": [
                              {
                                ""name"": ""id"",
                                ""description"": null,
                                ""type"": {
                                  ""name"": ""String"",
                                  ""kind"": ""SCALAR"",
                                  ""ofType"": null
                                },
                                ""defaultValue"": null
                              }
                              ]
                            },
                            {
                              ""name"": ""search"",
                              ""args"": [
                              {
                                ""name"": ""text"",
                                ""description"": null,
                                ""type"": {
                                  ""name"": ""String"",
                                  ""kind"": ""SCALAR"",
                                  ""ofType"": null
                                },
                                ""defaultValue"": null
                              }
                              ]
                            },
                            {
                              ""name"": ""__schema"",
                              ""args"": []
                            },
                            {
                              ""name"": ""__type"",
                              ""args"": [
                                {
                                  ""name"": ""name"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": ""String"",
                                    ""kind"": ""SCALAR"",
                                    ""ofType"": null
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""__typename"",
                              ""args"": []
                            }
                          ]
                        },
                        ""mutationType"": {
                          ""fields"": [
                            {
                              ""name"": ""mutate"",
                              ""args"": [
                                {
                                  ""name"": ""id"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""Int"",
                                      ""kind"": ""SCALAR""
                                    }
                                  },
                                  ""defaultValue"": null
                                },
                                {
                                  ""name"": ""newVal"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""Int"",
                                      ""kind"": ""SCALAR""
                                    }
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            },
                            {
                              ""name"": ""addMutate"",
                              ""args"": [
                                {
                                  ""name"": ""newVal"",
                                  ""description"": null,
                                  ""type"": {
                                    ""name"": null,
                                    ""kind"": ""NON_NULL"",
                                    ""ofType"": {
                                      ""name"": ""Int"",
                                      ""kind"": ""SCALAR""
                                    }
                                  },
                                  ""defaultValue"": null
                                }
                              ]
                            }
                          ]
                        }
                      }
                    }");
        }
Esempio n. 4
0
 [Test] public void LookupSingleEntityError() => GenericTests.LookupSingleEntityError(MemContext.CreateDefaultContext());
Esempio n. 5
0
 [Test] public void NestedEntity() => GenericTests.NestedEntity(MemContext.CreateDefaultContext());
 [Test] public static void InlineFragementWithoutTypenameFieldWithoutOtherFields() => GenericTests.InlineFragementWithoutTypenameFieldWithoutOtherFields(MemContext.CreateDefaultContext());
Esempio n. 7
0
 public static void StarWarsIntrospectionCharacterInterface() =>
 StarWarsTests.IntrospectionCharacterInterface(MemContext.CreateDefaultContext());
 [Test] public void SimpleMutation() => GenericTests.SimpleMutation(MemContext.CreateDefaultContext());
 [Test] public void MutationWithReturn() => GenericTests.MutationWithReturn(MemContext.CreateDefaultContext());
Esempio n. 10
0
 [Test] public void DateTimeFilter() => GenericTests.DateTimeFilter(MemContext.CreateDefaultContext());
Esempio n. 11
0
 [Test] public void EnumerableSubField() => GenericTests.EnumerableSubField(MemContext.CreateDefaultContext());
Esempio n. 12
0
 [Test] public void TypeName() => GenericTests.TypeName(MemContext.CreateDefaultContext());
Esempio n. 13
0
 [Test] public void PostFieldSubQuery() => GenericTests.PostFieldSubQuery(MemContext.CreateDefaultContext());
Esempio n. 14
0
 public void FullIntrospectionQuery()
 {
     var gql     = MemContext.CreateDefaultContext();
     var results = gql.ExecuteQuery(
         @"query IntrospectionQuery {
             __schema {
               queryType { name }
               mutationType { name }
               subscriptionType { name }
               types {
                 ...FullType
               }
               directives {
                 name
                 description
                 locations
                 args {
                   ...InputValue
                 }
               }
             }
           }
           fragment FullType on __Type {
             kind
             name
             description
             fields(includeDeprecated: true) {
               name
               description
               args {
                 ...InputValue
               }
               type {
                 ...TypeRef
               }
               isDeprecated
               deprecationReason
             }
             inputFields {
               ...InputValue
             }
             interfaces {
               ...TypeRef
             }
             enumValues(includeDeprecated: true) {
               name
               description
               isDeprecated
               deprecationReason
             }
             possibleTypes {
               ...TypeRef
             }
           }
           fragment InputValue on __InputValue {
             name
             description
             type { ...TypeRef }
             defaultValue
           }
           fragment TypeRef on __Type {
             kind
             name
             ofType {
               kind
               name
               ofType {
                 kind
                 name
                 ofType {
                   kind
                   name
                   ofType {
                     kind
                     name
                     ofType {
                       kind
                       name
                       ofType {
                         kind
                         name
                         ofType {
                           kind
                           name
                         }
                       }
                     }
                   }
                 }
               }
             }
           }
         "
         );
     // Must not throw
     // TODO: Add assertions
 }
Esempio n. 15
0
 [Test] public static void FragementWithMultiLevelInheritance() => GenericTests.FragementWithMultiLevelInheritance(MemContext.CreateDefaultContext());
Esempio n. 16
0
 [Test] public void NullPropagation() => GenericTests.NullPropagation(MemContext.CreateDefaultContext());
Esempio n. 17
0
 [Test] public static void FragementWithoutTypenameField() => GenericTests.FragementWithoutTypenameField(MemContext.CreateDefaultContext());
Esempio n. 18
0
 [Test] public void GuidField() => GenericTests.GuidField(MemContext.CreateDefaultContext());
Esempio n. 19
0
 [Test] public static void FragementWithMultipleTypenameFieldsMixedWithInlineFragment() => GenericTests.FragementWithMultipleTypenameFieldsMixedWithInlineFragment(MemContext.CreateDefaultContext());
Esempio n. 20
0
 [Test] public void GuidParameter() => GenericTests.GuidParameter(MemContext.CreateDefaultContext());
Esempio n. 21
0
 public static void UnionTypeDroid() =>
 StarWarsTests.UnionTypeDroid(MemContext.CreateDefaultContext());
Esempio n. 22
0
 [Test] public void ByteArrayParameter() => GenericTests.ByteArrayParameter(MemContext.CreateDefaultContext());
Esempio n. 23
0
 [Test] public void AliasOneField() => GenericTests.AliasOneField(MemContext.CreateDefaultContext());
Esempio n. 24
0
 [Test] public void ChildFieldWithParameters() => GenericTests.ChildFieldWithParameters(MemContext.CreateDefaultContext());
Esempio n. 25
0
 [Test] public void NoUserQueryReturnsNull() => GenericTests.NoUserQueryReturnsNull(MemContext.CreateDefaultContext());
Esempio n. 26
0
 [Test] public static void InlineFragements() => GenericTests.InlineFragements(MemContext.CreateDefaultContext());
Esempio n. 27
0
 [Test] public void List() => GenericTests.List(MemContext.CreateDefaultContext());
Esempio n. 28
0
 [Test] public void EnumFieldQuery() => GenericTests.EnumFieldQuery(MemContext.CreateDefaultContext());