public void Can_Have_Decimals_In_Schema()
        {
            var schema = Schema <SchemaTypeWithDecimal>();

            schema.ShouldHaveQueries(1);
            schema.ShouldHaveMutations(0);
            schema.Query.ShouldHaveFieldWithName("test");
            var result = schema.Execute((e) => e.Query = "query { test }");

            ResultHelpers.AssertNoErrorsInResult(result);
        }
Esempio n. 2
0
        public void Schema_Will_Execute_With_No_Errors_When_A_Type_Is_In_A_Linq_Iterator()
        {
            const string query = @"{
                testSelectIterator
                testWhereIterator
            }";

            var schema = Schema <BugReproSchemaTaskFirst>();
            var result = schema.Execute((e) => e.Query = query);

            ResultHelpers.AssertNoErrorsInResult(result);
            string testSelectIterator = (string)JObject.Parse(result)["data"]["testSelectIterator"][0];
            string testWhereIterator  = (string)JObject.Parse(result)["data"]["testWhereIterator"][0];

            Assert.AreEqual("Test", testSelectIterator);
            Assert.AreEqual("Test", testWhereIterator);
        }
Esempio n. 3
0
        public async Task Schema_Will_Execute_With_No_Errors_When_A_Type_Is_In_A_IDataLoaderResult()
        {
            const string query = @"{
                dataLoaderResult
                nestedDataLoaderResult
                anEnum
                nestedEnum
                namedResult
                resultProperty
            }";

            var schema = Schema <BugReproSchemaDataLoaderResult>();

            var result = await schema.ExecuteAsync((e) => e.Query = query);

            ResultHelpers.AssertNoErrorsInResult(result);
        }
        public void Schema_Will_Execute_With_No_Errors_When_A_Type_Is_In_A_Task()
        {
            const string query = @"{
                holders {
                    items {
                        interfaceConnection {
                            test
                        }
                    }
                }
            }";

            var schema = Schema <BugReproSchemaTaskFirst>();
            var result = schema.Execute((e) => e.Query = query);

            ResultHelpers.AssertNoErrorsInResult(result);

            schema = Schema <BugReproSchemaTaskSecond>();
            result = schema.Execute((e) => e.Query = query);
            ResultHelpers.AssertNoErrorsInResult(result);
        }