From 655af94856aac6a5c19ba7c0c932eba7e5d22243 Mon Sep 17 00:00:00 2001 From: shivaji-dgraph Date: Mon, 26 Aug 2024 12:06:32 +0530 Subject: [PATCH] fix failing tests --- graphql/resolve/add_mutation_test.yaml | 40 +------------------ graphql/schema/gqlschema_test.yml | 2 +- .../output/created-updated-directives.graphql | 8 ++-- ...ing-directive-with-similar-queries.graphql | 5 +++ 4 files changed, 12 insertions(+), 43 deletions(-) diff --git a/graphql/resolve/add_mutation_test.yaml b/graphql/resolve/add_mutation_test.yaml index dfa114f99a8..7c5202db9a6 100644 --- a/graphql/resolve/add_mutation_test.yaml +++ b/graphql/resolve/add_mutation_test.yaml @@ -5500,45 +5500,7 @@ { "message": "failed to rewrite mutation payload because field id cannot be empty" } - -- - name: "Add Mutation referencing same XID in different types" - gqlmutation: | - mutation($input: [AddT1Input!]!) { - addT1(input: $input) { - t1 { - name - name1 - name2 - link { - name - name1 - name3 - } - } - } - } - gqlvariables: | - { - "input": [ - { - "name": "Bob", - "name1": "Bob11", - "name2": "Bob2", - "link": { - "name": "Bob" - } - } - ] - } - explanation: "As the link and top level object contain the same XID, Bob, this should throw an error" - error: - { - "message": - "failed to rewrite mutation payload because using duplicate XID value: Bob for XID: name for two different - implementing types of same interfaces: T1 and T2" - } - + - name: "Add mutation with @default directive" gqlmutation: | diff --git a/graphql/schema/gqlschema_test.yml b/graphql/schema/gqlschema_test.yml index dfffc87ff8c..a82500b4426 100644 --- a/graphql/schema/gqlschema_test.yml +++ b/graphql/schema/gqlschema_test.yml @@ -2743,7 +2743,7 @@ invalid_schemas: review: String! } errlist: [ - {"message": "Type Product; @remote directive cannot be defined with @key directive", "locations": [ { "line": 176, "column": 12} ] }, + {"message": "Type Product; @remote directive cannot be defined with @key directive", "locations": [ { "line": 181, "column": 12} ] }, ] - name: "directives defined on @external fields that are not @key." diff --git a/graphql/schema/testdata/schemagen/output/created-updated-directives.graphql b/graphql/schema/testdata/schemagen/output/created-updated-directives.graphql index e54a114aa5e..d7547094db3 100644 --- a/graphql/schema/testdata/schemagen/output/created-updated-directives.graphql +++ b/graphql/schema/testdata/schemagen/output/created-updated-directives.graphql @@ -28,7 +28,7 @@ scalar Int64 """ The DateTime scalar type represents date and time as a string in RFC3339 format. -For example: "1985-04-12T23:20:50.52Z" represents 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC. +For example: "1985-04-12T23:20:50.52Z" represents 20 mins 50.52 secs after the 23rd hour of Apr 12th 1985 in UTC. """ scalar DateTime @@ -73,6 +73,7 @@ enum DgraphIndex { day hour geo + hnsw } input AuthRule { @@ -190,9 +191,10 @@ input GenerateMutationParams { } directive @hasInverse(field: String!) on FIELD_DEFINITION -directive @search(by: [DgraphIndex!]) on FIELD_DEFINITION +directive @search(by: [String!]) on FIELD_DEFINITION +directive @embedding on FIELD_DEFINITION directive @dgraph(type: String, pred: String) on OBJECT | INTERFACE | FIELD_DEFINITION -directive @id on FIELD_DEFINITION +directive @id(interface: Boolean) on FIELD_DEFINITION directive @default(add: DgraphDefault, update: DgraphDefault) on FIELD_DEFINITION directive @withSubscription on OBJECT | INTERFACE | FIELD_DEFINITION directive @secret(field: String!, pred: String) on OBJECT | INTERFACE diff --git a/graphql/schema/testdata/schemagen/output/embedding-directive-with-similar-queries.graphql b/graphql/schema/testdata/schemagen/output/embedding-directive-with-similar-queries.graphql index 77d52a9e96a..2a453101010 100644 --- a/graphql/schema/testdata/schemagen/output/embedding-directive-with-similar-queries.graphql +++ b/graphql/schema/testdata/schemagen/output/embedding-directive-with-similar-queries.graphql @@ -117,6 +117,10 @@ input CustomHTTP { skipIntrospection: Boolean } +input DgraphDefault { + value: String +} + type Point { longitude: Float! latitude: Float! @@ -200,6 +204,7 @@ directive @search(by: [String!]) on FIELD_DEFINITION directive @embedding on FIELD_DEFINITION directive @dgraph(type: String, pred: String) on OBJECT | INTERFACE | FIELD_DEFINITION directive @id(interface: Boolean) on FIELD_DEFINITION +directive @default(add: DgraphDefault, update: DgraphDefault) on FIELD_DEFINITION directive @withSubscription on OBJECT | INTERFACE | FIELD_DEFINITION directive @secret(field: String!, pred: String) on OBJECT | INTERFACE directive @auth(