示例#1
0
        private async Task AlterSchemaAgainAsExpected(IDgraphClient client)
        {
            var alterSchemaResult = await client.Alter(
                new Operation { Schema = ReadEmbeddedFile("altered.schema") });

            AssertResultIsSuccess(alterSchemaResult);

            Thread.Sleep(TimeSpan.FromSeconds(5));

            var response = await client.NewReadOnlyTransaction().Query("schema {}");

            AssertResultIsSuccess(response);

            var schema = JsonConvert.DeserializeObject <DgraphSchema>(response.Value.Json);

            this.Assent(schema.ToString(), AssentConfiguration);
        }
示例#2
0
        private async Task AlterSchemAsExpected(IDgraphClient client)
        {
            var alterSchemaResult = await client.Alter(
                new Operation { Schema = ReadEmbeddedFile("test.schema") });

            AssertResultIsSuccess(alterSchemaResult);

            // After an Alter, Dgraph computes indexes in the background.
            // So a first schema query after Alter might return a schema
            // without indexes.  We could poll and backoff and show that
            // ... but we aren't testing that here, just that the schema
            // updates.
            Thread.Sleep(TimeSpan.FromSeconds(5));

            var response = await client.NewReadOnlyTransaction().Query("schema {}");

            AssertResultIsSuccess(response);

            var schema = JsonConvert.DeserializeObject <DgraphSchema>(response.Value.Json);

            this.Assent(schema.ToString(), AssentConfiguration);
        }