Ejemplo n.º 1
0
 [Test] public static void InlineFragementWithListField() => GenericTests.InlineFragementWithListField(MemContext.CreateDefaultContext());
Ejemplo n.º 2
0
 [Test] public void CustomFieldSubQueryUsingContext() => GenericTests.CustomFieldSubQueryUsingContext(MemContext.CreateDefaultContext());
Ejemplo n.º 3
0
        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
                                }
                              ]
                            }
                          ]
                        }
                      }
                    }");
        }
Ejemplo n.º 4
0
 [Test] public void LookupSingleEntityError() => GenericTests.LookupSingleEntityError(MemContext.CreateDefaultContext());
Ejemplo n.º 5
0
 [Test] public void NestedEntity() => GenericTests.NestedEntity(MemContext.CreateDefaultContext());
Ejemplo n.º 6
0
 [Test] public static void InlineFragementWithoutTypenameFieldWithoutOtherFields() => GenericTests.InlineFragementWithoutTypenameFieldWithoutOtherFields(MemContext.CreateDefaultContext());
Ejemplo n.º 7
0
 public static void StarWarsIntrospectionCharacterInterface() =>
 StarWarsTests.IntrospectionCharacterInterface(MemContext.CreateDefaultContext());
Ejemplo n.º 8
0
 [Test] public void SimpleMutation() => GenericTests.SimpleMutation(MemContext.CreateDefaultContext());
Ejemplo n.º 9
0
 [Test] public void MutationWithReturn() => GenericTests.MutationWithReturn(MemContext.CreateDefaultContext());
Ejemplo n.º 10
0
 [Test] public void DateTimeFilter() => GenericTests.DateTimeFilter(MemContext.CreateDefaultContext());
Ejemplo n.º 11
0
 [Test] public void EnumerableSubField() => GenericTests.EnumerableSubField(MemContext.CreateDefaultContext());
Ejemplo n.º 12
0
 [Test] public void TypeName() => GenericTests.TypeName(MemContext.CreateDefaultContext());
Ejemplo n.º 13
0
 [Test] public void PostFieldSubQuery() => GenericTests.PostFieldSubQuery(MemContext.CreateDefaultContext());
Ejemplo 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
 }
Ejemplo n.º 15
0
 [Test] public static void FragementWithMultiLevelInheritance() => GenericTests.FragementWithMultiLevelInheritance(MemContext.CreateDefaultContext());
Ejemplo n.º 16
0
 [Test] public void NullPropagation() => GenericTests.NullPropagation(MemContext.CreateDefaultContext());
Ejemplo n.º 17
0
 [Test] public static void FragementWithoutTypenameField() => GenericTests.FragementWithoutTypenameField(MemContext.CreateDefaultContext());
Ejemplo n.º 18
0
 [Test] public void GuidField() => GenericTests.GuidField(MemContext.CreateDefaultContext());
Ejemplo n.º 19
0
 [Test] public static void FragementWithMultipleTypenameFieldsMixedWithInlineFragment() => GenericTests.FragementWithMultipleTypenameFieldsMixedWithInlineFragment(MemContext.CreateDefaultContext());
Ejemplo n.º 20
0
 [Test] public void GuidParameter() => GenericTests.GuidParameter(MemContext.CreateDefaultContext());
Ejemplo n.º 21
0
 public static void UnionTypeDroid() =>
 StarWarsTests.UnionTypeDroid(MemContext.CreateDefaultContext());
Ejemplo n.º 22
0
 [Test] public void ByteArrayParameter() => GenericTests.ByteArrayParameter(MemContext.CreateDefaultContext());
Ejemplo n.º 23
0
 [Test] public void AliasOneField() => GenericTests.AliasOneField(MemContext.CreateDefaultContext());
Ejemplo n.º 24
0
 [Test] public void ChildFieldWithParameters() => GenericTests.ChildFieldWithParameters(MemContext.CreateDefaultContext());
Ejemplo n.º 25
0
 [Test] public void NoUserQueryReturnsNull() => GenericTests.NoUserQueryReturnsNull(MemContext.CreateDefaultContext());
Ejemplo n.º 26
0
 [Test] public static void InlineFragements() => GenericTests.InlineFragements(MemContext.CreateDefaultContext());
Ejemplo n.º 27
0
 [Test] public void List() => GenericTests.List(MemContext.CreateDefaultContext());
Ejemplo n.º 28
0
 [Test] public void EnumFieldQuery() => GenericTests.EnumFieldQuery(MemContext.CreateDefaultContext());