[Test] public static void InlineFragementWithListField() => GenericTests.InlineFragementWithListField(MemContext.CreateDefaultContext());
Exemple #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
                                }
                              ]
                            }
                          ]
                        }
                      }
                    }");
        }
Exemple #4
0
 [Test] public void LookupSingleEntityError() => GenericTests.LookupSingleEntityError(MemContext.CreateDefaultContext());
Exemple #5
0
 [Test] public void NestedEntity() => GenericTests.NestedEntity(MemContext.CreateDefaultContext());
 [Test] public static void InlineFragementWithoutTypenameFieldWithoutOtherFields() => GenericTests.InlineFragementWithoutTypenameFieldWithoutOtherFields(MemContext.CreateDefaultContext());
Exemple #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());
 [Test] public void DateTimeFilter() => GenericTests.DateTimeFilter(MemContext.CreateDefaultContext());
 [Test] public void EnumerableSubField() => GenericTests.EnumerableSubField(MemContext.CreateDefaultContext());
 [Test] public void TypeName() => GenericTests.TypeName(MemContext.CreateDefaultContext());
 [Test] public void PostFieldSubQuery() => GenericTests.PostFieldSubQuery(MemContext.CreateDefaultContext());
 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
 }
 [Test] public static void FragementWithMultiLevelInheritance() => GenericTests.FragementWithMultiLevelInheritance(MemContext.CreateDefaultContext());
 [Test] public void NullPropagation() => GenericTests.NullPropagation(MemContext.CreateDefaultContext());
 [Test] public static void FragementWithoutTypenameField() => GenericTests.FragementWithoutTypenameField(MemContext.CreateDefaultContext());
 [Test] public void GuidField() => GenericTests.GuidField(MemContext.CreateDefaultContext());
 [Test] public static void FragementWithMultipleTypenameFieldsMixedWithInlineFragment() => GenericTests.FragementWithMultipleTypenameFieldsMixedWithInlineFragment(MemContext.CreateDefaultContext());
 [Test] public void GuidParameter() => GenericTests.GuidParameter(MemContext.CreateDefaultContext());
Exemple #21
0
 public static void UnionTypeDroid() =>
 StarWarsTests.UnionTypeDroid(MemContext.CreateDefaultContext());
 [Test] public void ByteArrayParameter() => GenericTests.ByteArrayParameter(MemContext.CreateDefaultContext());
Exemple #23
0
 [Test] public void AliasOneField() => GenericTests.AliasOneField(MemContext.CreateDefaultContext());
 [Test] public void ChildFieldWithParameters() => GenericTests.ChildFieldWithParameters(MemContext.CreateDefaultContext());
Exemple #25
0
 [Test] public void NoUserQueryReturnsNull() => GenericTests.NoUserQueryReturnsNull(MemContext.CreateDefaultContext());
 [Test] public static void InlineFragements() => GenericTests.InlineFragements(MemContext.CreateDefaultContext());
Exemple #27
0
 [Test] public void List() => GenericTests.List(MemContext.CreateDefaultContext());
Exemple #28
0
 [Test] public void EnumFieldQuery() => GenericTests.EnumFieldQuery(MemContext.CreateDefaultContext());