From 3ad518e2cbd416c5f5f526eac835435a026d0829 Mon Sep 17 00:00:00 2001 From: Shahzad Lone Date: Thu, 19 Oct 2023 15:05:57 -0400 Subject: [PATCH] PR(MAIN): Rename `dockey/dockeys` to `docID(s)` --- README.md | 2 +- client/request/consts.go | 11 +++----- merkle/clock/clock_test.go | 9 +++++- planner/commit.go | 2 +- request/graphql/parser/commit.go | 2 +- request/graphql/parser/query.go | 4 +-- request/graphql/schema/generate.go | 26 ++++++++--------- request/graphql/schema/types/commits.go | 12 ++++---- request/graphql/schema/types/types.go | 3 -- tests/bench/query/simple/utils.go | 4 +-- .../query/simple/with_multi_lookup_test.go | 4 +-- .../query/simple/with_single_lookup_test.go | 4 +-- .../integration/explain/debug/dagscan_test.go | 18 ++++++------ .../debug/group_with_dockey_child_test.go | 4 +-- .../explain/debug/group_with_dockey_test.go | 8 +++--- .../type_join_with_filter_and_key_test.go | 4 +-- .../explain/debug/with_filter_key_test.go | 16 +++++------ .../explain/default/dagscan_test.go | 18 ++++++------ .../default/group_with_dockey_child_test.go | 6 ++-- .../explain/default/group_with_dockey_test.go | 8 +++--- .../type_join_with_filter_and_key_test.go | 4 +-- .../explain/default/with_filter_key_test.go | 16 +++++------ .../explain/execute/dagscan_test.go | 4 +-- .../mutation/delete/with_ids_txn_test.go | 2 +- .../query/commits/with_dockey_cid_test.go | 12 ++++---- .../query/commits/with_dockey_count_test.go | 4 +-- .../query/commits/with_dockey_field_test.go | 22 +++++++-------- .../commits/with_dockey_group_order_test.go | 10 +++---- .../commits/with_dockey_limit_offset_test.go | 4 +-- .../query/commits/with_dockey_limit_test.go | 4 +-- .../with_dockey_order_limit_offset_test.go | 4 +-- .../query/commits/with_dockey_order_test.go | 20 ++++++------- .../query/commits/with_dockey_prop_test.go | 10 +++---- .../query/commits/with_dockey_test.go | 20 ++++++------- .../commits/with_dockey_typename_test.go | 4 +-- .../query/commits/with_group_test.go | 10 +++---- .../query/latest_commits/simple_test.go | 2 +- .../with_collectionid_prop_test.go | 4 +-- .../latest_commits/with_dockey_field_test.go | 12 ++++---- .../latest_commits/with_dockey_prop_test.go | 8 +++--- .../query/latest_commits/with_dockey_test.go | 8 +++--- .../query/latest_commits/with_field_test.go | 4 +-- .../query/one_to_many/with_cid_dockey_test.go | 20 ++++++------- .../query/one_to_many/with_dockey_test.go | 4 +-- .../query/one_to_many/with_dockeys_test.go | 4 +-- .../query/simple/with_cid_dockey_test.go | 28 +++++++++---------- .../query/simple/with_dockey_test.go | 12 ++++---- .../query/simple/with_dockeys_test.go | 20 ++++++------- .../query/simple/with_group_dockey_test.go | 4 +-- .../query/simple/with_group_dockeys_test.go | 4 +-- .../query/simple/with_version_test.go | 10 +++---- tests/integration/schema/default_fields.go | 10 +++++-- .../migrations/query/with_dockey_test.go | 16 +++++------ 53 files changed, 245 insertions(+), 240 deletions(-) diff --git a/README.md b/README.md index fe98c1f9f6..d73e268ef7 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ To get the most recent commit in the MerkleDAG for the document identified as `b ```shell defradb client query ' query { - latestCommits(dockey: "bae-91171025-ed21-50e3-b0dc-e31bccdfa1ab") { + latestCommits(docID: "bae-91171025-ed21-50e3-b0dc-e31bccdfa1ab") { cid delta height diff --git a/client/request/consts.go b/client/request/consts.go index 402c437b49..890355925a 100644 --- a/client/request/consts.go +++ b/client/request/consts.go @@ -21,15 +21,10 @@ const ( Cid = "cid" Data = "data" - DocKey = "dockey" - DocKeys = "dockeys" FieldName = "field" FieldIDName = "fieldId" ShowDeleted = "showDeleted" - DocID = "docID" - DocIDs = "docIDs" - FilterClause = "filter" GroupByClause = "groupBy" LimitClause = "limit" @@ -37,6 +32,9 @@ const ( OrderClause = "order" DepthClause = "depth" + DocID = "docID" + DocIDs = "docIDs" + AverageFieldName = "_avg" CountFieldName = "_count" KeyFieldName = "_docID" @@ -58,7 +56,6 @@ const ( LinksFieldName = "links" HeightFieldName = "height" CidFieldName = "cid" - DockeyFieldName = "dockey" CollectionIDFieldName = "collectionID" SchemaVersionIDFieldName = "schemaVersionId" FieldNameFieldName = "fieldName" @@ -103,7 +100,7 @@ var ( VersionFields = []string{ HeightFieldName, CidFieldName, - DockeyFieldName, + DocID, CollectionIDFieldName, SchemaVersionIDFieldName, FieldNameFieldName, diff --git a/merkle/clock/clock_test.go b/merkle/clock/clock_test.go index a804165062..3bafc51d1f 100644 --- a/merkle/clock/clock_test.go +++ b/merkle/clock/clock_test.go @@ -17,6 +17,7 @@ import ( cid "github.com/ipfs/go-cid" ds "github.com/ipfs/go-datastore" + "github.com/sourcenetwork/defradb/client/request" "github.com/sourcenetwork/defradb/core" ccid "github.com/sourcenetwork/defradb/core/cid" "github.com/sourcenetwork/defradb/core/crdt" @@ -32,7 +33,13 @@ func newTestMerkleClock() *MerkleClock { multistore := datastore.MultiStoreFrom(s) reg := crdt.NewLWWRegister(multistore.Rootstore(), core.CollectionSchemaVersionKey{}, core.DataStoreKey{}, "") - return NewMerkleClock(multistore.Headstore(), multistore.DAGstore(), core.HeadStoreKey{DocKey: "dockey", FieldId: "1"}, reg).(*MerkleClock) + return NewMerkleClock( + multistore.Headstore(), + multistore.DAGstore(), + core.HeadStoreKey{DocKey: request.DocID, FieldId: "1"}, + reg, + ).(*MerkleClock) + } func TestNewMerkleClock(t *testing.T) { diff --git a/planner/commit.go b/planner/commit.go index c2cff28c30..d53a213feb 100644 --- a/planner/commit.go +++ b/planner/commit.go @@ -351,7 +351,7 @@ func (n *dagScanNode) dagBlockToNodeDoc(block blocks.Block) (core.Doc, []*ipld.L } n.commitSelect.DocumentMapping.SetFirstOfName(&commit, - request.DockeyFieldName, string(dockey)) + request.DocID, string(dockey)) collection, err := n.planner.db.GetCollectionByVersionID(n.planner.ctx, schemaVersionId) if err != nil { diff --git a/request/graphql/parser/commit.go b/request/graphql/parser/commit.go index 836fd9d167..60b13cc24d 100644 --- a/request/graphql/parser/commit.go +++ b/request/graphql/parser/commit.go @@ -31,7 +31,7 @@ func parseCommitSelect(schema gql.Schema, parent *gql.Object, field *ast.Field) for _, argument := range field.Arguments { prop := argument.Name.Value - if prop == request.DocKey { + if prop == request.DocID { raw := argument.Value.(*ast.StringValue) commit.DocKey = immutable.Some(raw.Value) } else if prop == request.Cid { diff --git a/request/graphql/parser/query.go b/request/graphql/parser/query.go index 9e17b15955..c4cbde0691 100644 --- a/request/graphql/parser/query.go +++ b/request/graphql/parser/query.go @@ -124,10 +124,10 @@ func parseSelect( } slct.Filter = filter - case request.DocKey: // parse single dockey query field + case request.DocID: // parse single document id field val := astValue.(*ast.StringValue) slct.DocKeys = immutable.Some([]string{val.Value}) - case request.DocKeys: + case request.DocIDs: docKeyValues := astValue.(*ast.ListValue).Values docKeys := make([]string, len(docKeyValues)) for i, value := range docKeyValues { diff --git a/request/graphql/schema/generate.go b/request/graphql/schema/generate.go index 5d5fa67b25..58cfbe461c 100644 --- a/request/graphql/schema/generate.go +++ b/request/graphql/schema/generate.go @@ -322,8 +322,8 @@ func (g *Generator) createExpandedFieldList( Description: f.Description, Type: gql.NewList(t), Args: gql.FieldConfigArgument{ - "dockey": schemaTypes.NewArgConfig(gql.String, dockeyArgDescription), - "dockeys": schemaTypes.NewArgConfig(gql.NewList(gql.NewNonNull(gql.String)), dockeysArgDescription), + request.DocID: schemaTypes.NewArgConfig(gql.String, dockeyArgDescription), + request.DocIDs: schemaTypes.NewArgConfig(gql.NewList(gql.NewNonNull(gql.String)), dockeysArgDescription), "filter": schemaTypes.NewArgConfig( g.manager.schema.TypeMap()[typeName+"FilterArg"], listFieldFilterArgDescription, @@ -942,10 +942,10 @@ func (g *Generator) genTypeMutationUpdateField( Description: updateDocumentsDescription, Type: gql.NewList(obj), Args: gql.FieldConfigArgument{ - schemaTypes.DocID: schemaTypes.NewArgConfig(gql.ID, updateIDArgDescription), - schemaTypes.DocIDs: schemaTypes.NewArgConfig(gql.NewList(gql.ID), updateIDsArgDescription), - "filter": schemaTypes.NewArgConfig(filter, updateFilterArgDescription), - "data": schemaTypes.NewArgConfig(gql.String, updateDataArgDescription), + request.DocID: schemaTypes.NewArgConfig(gql.ID, updateIDArgDescription), + request.DocIDs: schemaTypes.NewArgConfig(gql.NewList(gql.ID), updateIDsArgDescription), + "filter": schemaTypes.NewArgConfig(filter, updateFilterArgDescription), + "data": schemaTypes.NewArgConfig(gql.String, updateDataArgDescription), }, } return field, nil @@ -960,9 +960,9 @@ func (g *Generator) genTypeMutationDeleteField( Description: deleteDocumentsDescription, Type: gql.NewList(obj), Args: gql.FieldConfigArgument{ - schemaTypes.DocID: schemaTypes.NewArgConfig(gql.ID, deleteIDArgDescription), - schemaTypes.DocIDs: schemaTypes.NewArgConfig(gql.NewList(gql.ID), deleteIDsArgDescription), - "filter": schemaTypes.NewArgConfig(filter, deleteFilterArgDescription), + request.DocID: schemaTypes.NewArgConfig(gql.ID, deleteIDArgDescription), + request.DocIDs: schemaTypes.NewArgConfig(gql.NewList(gql.ID), deleteIDsArgDescription), + "filter": schemaTypes.NewArgConfig(filter, deleteFilterArgDescription), }, } return field, nil @@ -1159,10 +1159,10 @@ func (g *Generator) genTypeQueryableFieldList( Description: obj.Description(), Type: gql.NewList(obj), Args: gql.FieldConfigArgument{ - "dockey": schemaTypes.NewArgConfig(gql.String, dockeyArgDescription), - "dockeys": schemaTypes.NewArgConfig(gql.NewList(gql.NewNonNull(gql.String)), dockeysArgDescription), - "cid": schemaTypes.NewArgConfig(gql.String, cidArgDescription), - "filter": schemaTypes.NewArgConfig(config.filter, selectFilterArgDescription), + request.DocID: schemaTypes.NewArgConfig(gql.String, dockeyArgDescription), + request.DocIDs: schemaTypes.NewArgConfig(gql.NewList(gql.NewNonNull(gql.String)), dockeysArgDescription), + "cid": schemaTypes.NewArgConfig(gql.String, cidArgDescription), + "filter": schemaTypes.NewArgConfig(config.filter, selectFilterArgDescription), "groupBy": schemaTypes.NewArgConfig( gql.NewList(gql.NewNonNull(config.groupBy)), schemaTypes.GroupByArgDescription, diff --git a/request/graphql/schema/types/commits.go b/request/graphql/schema/types/commits.go index 44a13b637f..326d55a002 100644 --- a/request/graphql/schema/types/commits.go +++ b/request/graphql/schema/types/commits.go @@ -55,7 +55,7 @@ var ( Description: commitCIDFieldDescription, Type: gql.String, }, - "dockey": &gql.Field{ + request.DocID: &gql.Field{ Description: commitDockeyFieldDescription, Type: gql.String, }, @@ -125,7 +125,7 @@ var ( Description: commitCIDFieldDescription, Type: OrderingEnum, }, - "dockey": &gql.InputObjectFieldConfig{ + request.DocID: &gql.InputObjectFieldConfig{ Description: commitDockeyFieldDescription, Type: OrderingEnum, }, @@ -150,8 +150,8 @@ var ( Value: "cid", Description: commitCIDFieldDescription, }, - "dockey": &gql.EnumValueConfig{ - Value: "dockey", + request.DocID: &gql.EnumValueConfig{ + Value: request.DocID, Description: commitDockeyFieldDescription, }, "collectionID": &gql.EnumValueConfig{ @@ -175,7 +175,7 @@ var ( Description: commitsQueryDescription, Type: gql.NewList(CommitObject), Args: gql.FieldConfigArgument{ - "dockey": NewArgConfig(gql.ID, commitDockeyArgDescription), + request.DocID: NewArgConfig(gql.ID, commitDockeyArgDescription), request.FieldIDName: NewArgConfig(gql.String, commitFieldIDArgDescription), "order": NewArgConfig(CommitsOrderArg, OrderArgDescription), "cid": NewArgConfig(gql.ID, commitCIDArgDescription), @@ -198,7 +198,7 @@ var ( Description: latestCommitsQueryDescription, Type: gql.NewList(CommitObject), Args: gql.FieldConfigArgument{ - "dockey": NewArgConfig(gql.NewNonNull(gql.ID), commitDockeyArgDescription), + request.DocID: NewArgConfig(gql.NewNonNull(gql.ID), commitDockeyArgDescription), request.FieldIDName: NewArgConfig(gql.String, commitFieldIDArgDescription), }, } diff --git a/request/graphql/schema/types/types.go b/request/graphql/schema/types/types.go index c340853f90..75f91fb2c5 100644 --- a/request/graphql/schema/types/types.go +++ b/request/graphql/schema/types/types.go @@ -24,9 +24,6 @@ const ( ExplainArgExecute string = "execute" ExplainArgDebug string = "debug" - DocID string = "docID" - DocIDs string = "docIDs" - IndexDirectiveLabel = "index" IndexDirectivePropName = "name" IndexDirectivePropFields = "fields" diff --git a/tests/bench/query/simple/utils.go b/tests/bench/query/simple/utils.go index 8c6f82579b..f8b84b4c62 100644 --- a/tests/bench/query/simple/utils.go +++ b/tests/bench/query/simple/utils.go @@ -90,7 +90,7 @@ func runQueryBenchGetSync( } func formatQuery(b *testing.B, query string, dockeys [][]client.DocKey) string { - numPlaceholders := strings.Count(query, "{{dockey}}") + numPlaceholders := strings.Count(query, "{{docID}}") if numPlaceholders == 0 { return query } @@ -119,7 +119,7 @@ func formatQuery(b *testing.B, query string, dockeys [][]client.DocKey) string { dockeysCopy = append(dockeysCopy[:rIndex], dockeysCopy[rIndex+1:]...) // replace - query = strings.Replace(query, "{{dockey}}", key.String(), 1) + query = strings.Replace(query, "{{docID}}", key.String(), 1) } // b.Logf("Query After: %s", query) diff --git a/tests/bench/query/simple/with_multi_lookup_test.go b/tests/bench/query/simple/with_multi_lookup_test.go index 99d374924b..f862095189 100644 --- a/tests/bench/query/simple/with_multi_lookup_test.go +++ b/tests/bench/query/simple/with_multi_lookup_test.go @@ -18,10 +18,10 @@ import ( ) var ( - // 10x dockey will be replaced in the bench runner func + // 10x `docID`s will be replaced in the bench runner func userSimpleWithMultiLookupQuery = ` query { - User(dockeys: ["{{dockey}}", "{{dockey}}", "{{dockey}}", "{{dockey}}", "{{dockey}}", "{{dockey}}", "{{dockey}}", "{{dockey}}", "{{dockey}}", "{{dockey}}"]) { + User(docIDs: ["{{docID}}", "{{docID}}", "{{docID}}", "{{docID}}", "{{docID}}", "{{docID}}", "{{docID}}", "{{docID}}", "{{docID}}", "{{docID}}"]) { _docID Name Age diff --git a/tests/bench/query/simple/with_single_lookup_test.go b/tests/bench/query/simple/with_single_lookup_test.go index 1704c59536..088fbd22d0 100644 --- a/tests/bench/query/simple/with_single_lookup_test.go +++ b/tests/bench/query/simple/with_single_lookup_test.go @@ -18,10 +18,10 @@ import ( ) var ( - // dockey will be replaced in the bench runner func + // The `docID` will be replaced in the bench runner func userSimpleWithSingleLookupQuery = ` query { - User(dockey: "{{dockey}}") { + User(docID: "{{docID}}") { _docID Name Age diff --git a/tests/integration/explain/debug/dagscan_test.go b/tests/integration/explain/debug/dagscan_test.go index 647d378907..8f940d36ed 100644 --- a/tests/integration/explain/debug/dagscan_test.go +++ b/tests/integration/explain/debug/dagscan_test.go @@ -38,7 +38,7 @@ func TestDebugExplainCommitsDagScanQueryOp(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain(type: debug) { - commits (dockey: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3", fieldId: "1") { + commits (docID: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3", fieldId: "1") { links { cid } @@ -56,7 +56,7 @@ func TestDebugExplainCommitsDagScanQueryOp(t *testing.T) { func TestDebugExplainCommitsDagScanQueryOpWithoutField(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) commits query-op with only dockey (no field).", + Description: "Explain (debug) commits query-op with only docID (no field).", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -64,7 +64,7 @@ func TestDebugExplainCommitsDagScanQueryOpWithoutField(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain(type: debug) { - commits (dockey: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3") { + commits (docID: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3") { links { cid } @@ -90,7 +90,7 @@ func TestDebugExplainLatestCommitsDagScanQueryOp(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain(type: debug) { - latestCommits(dockey: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3", fieldId: "1") { + latestCommits(docID: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3", fieldId: "1") { cid links { cid @@ -109,7 +109,7 @@ func TestDebugExplainLatestCommitsDagScanQueryOp(t *testing.T) { func TestDebugExplainLatestCommitsDagScanQueryOpWithoutField(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) latestCommits query-op with only dockey (no field).", + Description: "Explain (debug) latestCommits query-op with only docID (no field).", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -117,7 +117,7 @@ func TestDebugExplainLatestCommitsDagScanQueryOpWithoutField(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain(type: debug) { - latestCommits(dockey: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3") { + latestCommits(docID: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3") { cid links { cid @@ -136,7 +136,7 @@ func TestDebugExplainLatestCommitsDagScanQueryOpWithoutField(t *testing.T) { func TestDebugExplainLatestCommitsDagScanWithoutDocKey_Failure(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) latestCommits query without DocKey.", + Description: "Explain (debug) latestCommits query without docID.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -152,7 +152,7 @@ func TestDebugExplainLatestCommitsDagScanWithoutDocKey_Failure(t *testing.T) { } }`, - ExpectedError: "Field \"latestCommits\" argument \"dockey\" of type \"ID!\" is required but not provided.", + ExpectedError: "Field \"latestCommits\" argument \"docID\" of type \"ID!\" is required but not provided.", }, }, } @@ -179,7 +179,7 @@ func TestDebugExplainLatestCommitsDagScanWithoutAnyArguments_Failure(t *testing. } }`, - ExpectedError: "Field \"latestCommits\" argument \"dockey\" of type \"ID!\" is required but not provided.", + ExpectedError: "Field \"latestCommits\" argument \"docID\" of type \"ID!\" is required but not provided.", }, }, } diff --git a/tests/integration/explain/debug/group_with_dockey_child_test.go b/tests/integration/explain/debug/group_with_dockey_child_test.go index bc6555b961..755e0e1c14 100644 --- a/tests/integration/explain/debug/group_with_dockey_child_test.go +++ b/tests/integration/explain/debug/group_with_dockey_child_test.go @@ -20,7 +20,7 @@ import ( func TestDebugExplainRequestWithDockeysOnInnerGroupSelection(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) request with dockeys on inner _group.", + Description: "Explain (debug) request with docIDs on inner _group.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -32,7 +32,7 @@ func TestDebugExplainRequestWithDockeysOnInnerGroupSelection(t *testing.T) { groupBy: [age] ) { age - _group(dockeys: ["bae-6a4c5bc5-b044-5a03-a868-8260af6f2254"]) { + _group(docIDs: ["bae-6a4c5bc5-b044-5a03-a868-8260af6f2254"]) { name } } diff --git a/tests/integration/explain/debug/group_with_dockey_test.go b/tests/integration/explain/debug/group_with_dockey_test.go index fc53731c6a..390469f1bd 100644 --- a/tests/integration/explain/debug/group_with_dockey_test.go +++ b/tests/integration/explain/debug/group_with_dockey_test.go @@ -20,7 +20,7 @@ import ( func TestDebugExplainRequestWithDockeyOnParentGroupBy(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) request with a dockey on parent groupBy.", + Description: "Explain (debug) request with a document ID on parent groupBy.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -30,7 +30,7 @@ func TestDebugExplainRequestWithDockeyOnParentGroupBy(t *testing.T) { Request: `query @explain(type: debug) { Author( groupBy: [age], - dockey: "bae-6a4c5bc5-b044-5a03-a868-8260af6f2254" + docID: "bae-6a4c5bc5-b044-5a03-a868-8260af6f2254" ) { age _group { @@ -50,7 +50,7 @@ func TestDebugExplainRequestWithDockeyOnParentGroupBy(t *testing.T) { func TestDebugExplainRequestWithDockeysAndFilterOnParentGroupBy(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) request with dockeys and filter on parent groupBy.", + Description: "Explain (debug) request with document IDs and filter on parent groupBy.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -61,7 +61,7 @@ func TestDebugExplainRequestWithDockeysAndFilterOnParentGroupBy(t *testing.T) { Author( groupBy: [age], filter: {age: {_eq: 20}}, - dockeys: [ + docIDs: [ "bae-6a4c5bc5-b044-5a03-a868-8260af6f2254", "bae-4ea9d148-13f3-5a48-a0ef-9ffd344caeed" ] diff --git a/tests/integration/explain/debug/type_join_with_filter_and_key_test.go b/tests/integration/explain/debug/type_join_with_filter_and_key_test.go index 5219c5c874..292709feb3 100644 --- a/tests/integration/explain/debug/type_join_with_filter_and_key_test.go +++ b/tests/integration/explain/debug/type_join_with_filter_and_key_test.go @@ -33,7 +33,7 @@ func TestDebugExplainRequestWithRelatedAndRegularFilterAndKeys(t *testing.T) { name: {_eq: "John Grisham"}, books: {name: {_eq: "Painted House"}} }, - dockeys: [ + docIDs: [ "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d", "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f8e" ] @@ -80,7 +80,7 @@ func TestDebugExplainRequestWithManyRelatedFiltersAndKey(t *testing.T) { articles: {name: {_eq: "To my dear readers"}}, books: {name: {_eq: "Theif Lord"}} }, - dockeys: ["bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d"] + docIDs: ["bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d"] ) { name age diff --git a/tests/integration/explain/debug/with_filter_key_test.go b/tests/integration/explain/debug/with_filter_key_test.go index e9f279687f..3b6c157fd9 100644 --- a/tests/integration/explain/debug/with_filter_key_test.go +++ b/tests/integration/explain/debug/with_filter_key_test.go @@ -20,7 +20,7 @@ import ( func TestDebugExplainRequestWithDocKeyFilter(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) request with dockey filter.", + Description: "Explain (debug) request with docID filter.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -28,7 +28,7 @@ func TestDebugExplainRequestWithDocKeyFilter(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain(type: debug) { - Author(dockey: "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d") { + Author(docID: "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d") { name age } @@ -45,7 +45,7 @@ func TestDebugExplainRequestWithDocKeyFilter(t *testing.T) { func TestDebugExplainRequestWithDocKeysFilterUsingOneKey(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) request with dockeys filter using one key.", + Description: "Explain (debug) request with docIDs filter using one key.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -53,7 +53,7 @@ func TestDebugExplainRequestWithDocKeysFilterUsingOneKey(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain(type: debug) { - Author(dockeys: ["bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d"]) { + Author(docIDs: ["bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d"]) { name age } @@ -70,7 +70,7 @@ func TestDebugExplainRequestWithDocKeysFilterUsingOneKey(t *testing.T) { func TestDebugExplainRequestWithDocKeysFilterUsingMultipleButDuplicateKeys(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) request with dockeys filter using multiple but duplicate keys.", + Description: "Explain (debug) request with docIDs filter using multiple but duplicate keys.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -79,7 +79,7 @@ func TestDebugExplainRequestWithDocKeysFilterUsingMultipleButDuplicateKeys(t *te Request: `query @explain(type: debug) { Author( - dockeys: [ + docIDs: [ "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d", "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d" ] @@ -100,7 +100,7 @@ func TestDebugExplainRequestWithDocKeysFilterUsingMultipleButDuplicateKeys(t *te func TestDebugExplainRequestWithDocKeysFilterUsingMultipleUniqueKeys(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (debug) request with dockeys filter using multiple unique keys.", + Description: "Explain (debug) request with docIDs filter using multiple unique keys.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -109,7 +109,7 @@ func TestDebugExplainRequestWithDocKeysFilterUsingMultipleUniqueKeys(t *testing. Request: `query @explain(type: debug) { Author( - dockeys: [ + docIDs: [ "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d", "bae-bfbfc89c-0d63-5ea4-81a3-3ebd295be67f" ] diff --git a/tests/integration/explain/default/dagscan_test.go b/tests/integration/explain/default/dagscan_test.go index a83402bb67..88828999b7 100644 --- a/tests/integration/explain/default/dagscan_test.go +++ b/tests/integration/explain/default/dagscan_test.go @@ -38,7 +38,7 @@ func TestDefaultExplainCommitsDagScanQueryOp(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain { - commits (dockey: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3", fieldId: "1") { + commits (docID: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3", fieldId: "1") { links { cid } @@ -73,7 +73,7 @@ func TestDefaultExplainCommitsDagScanQueryOp(t *testing.T) { func TestDefaultExplainCommitsDagScanQueryOpWithoutField(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) commits query-op with only dockey (no field).", + Description: "Explain (default) commits query-op with only docID (no field).", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -81,7 +81,7 @@ func TestDefaultExplainCommitsDagScanQueryOpWithoutField(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain { - commits (dockey: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3") { + commits (docID: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3") { links { cid } @@ -124,7 +124,7 @@ func TestDefaultExplainLatestCommitsDagScanQueryOp(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain { - latestCommits(dockey: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3", fieldId: "1") { + latestCommits(docID: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3", fieldId: "1") { cid links { cid @@ -160,7 +160,7 @@ func TestDefaultExplainLatestCommitsDagScanQueryOp(t *testing.T) { func TestDefaultExplainLatestCommitsDagScanQueryOpWithoutField(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) latestCommits query-op with only dockey (no field).", + Description: "Explain (default) latestCommits query-op with only docID (no field).", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -168,7 +168,7 @@ func TestDefaultExplainLatestCommitsDagScanQueryOpWithoutField(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain { - latestCommits(dockey: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3") { + latestCommits(docID: "bae-41598f0c-19bc-5da6-813b-e80f14a10df3") { cid links { cid @@ -204,7 +204,7 @@ func TestDefaultExplainLatestCommitsDagScanQueryOpWithoutField(t *testing.T) { func TestDefaultExplainLatestCommitsDagScanWithoutDocKey_Failure(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) latestCommits query without DocKey.", + Description: "Explain (default) latestCommits query without docID.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -220,7 +220,7 @@ func TestDefaultExplainLatestCommitsDagScanWithoutDocKey_Failure(t *testing.T) { } }`, - ExpectedError: "Field \"latestCommits\" argument \"dockey\" of type \"ID!\" is required but not provided.", + ExpectedError: "Field \"latestCommits\" argument \"docID\" of type \"ID!\" is required but not provided.", }, }, } @@ -247,7 +247,7 @@ func TestDefaultExplainLatestCommitsDagScanWithoutAnyArguments_Failure(t *testin } }`, - ExpectedError: "Field \"latestCommits\" argument \"dockey\" of type \"ID!\" is required but not provided.", + ExpectedError: "Field \"latestCommits\" argument \"docID\" of type \"ID!\" is required but not provided.", }, }, } diff --git a/tests/integration/explain/default/group_with_dockey_child_test.go b/tests/integration/explain/default/group_with_dockey_child_test.go index 35726cda32..0b785df176 100644 --- a/tests/integration/explain/default/group_with_dockey_child_test.go +++ b/tests/integration/explain/default/group_with_dockey_child_test.go @@ -20,7 +20,7 @@ import ( func TestDefaultExplainRequestWithDockeysOnInnerGroupSelection(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) request with dockeys on inner _group.", + Description: "Explain (default) request with docIDs on inner _group.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -32,7 +32,7 @@ func TestDefaultExplainRequestWithDockeysOnInnerGroupSelection(t *testing.T) { groupBy: [age] ) { age - _group(dockeys: ["bae-6a4c5bc5-b044-5a03-a868-8260af6f2254"]) { + _group(docIDs: ["bae-6a4c5bc5-b044-5a03-a868-8260af6f2254"]) { name } } @@ -49,7 +49,7 @@ func TestDefaultExplainRequestWithDockeysOnInnerGroupSelection(t *testing.T) { "childSelects": []dataMap{ { "collectionName": "Author", - "docKeys": []string{"bae-6a4c5bc5-b044-5a03-a868-8260af6f2254"}, + "docIDs": []string{"bae-6a4c5bc5-b044-5a03-a868-8260af6f2254"}, "filter": nil, "groupBy": nil, "limit": nil, diff --git a/tests/integration/explain/default/group_with_dockey_test.go b/tests/integration/explain/default/group_with_dockey_test.go index 31555bc94a..f14998d2ce 100644 --- a/tests/integration/explain/default/group_with_dockey_test.go +++ b/tests/integration/explain/default/group_with_dockey_test.go @@ -20,7 +20,7 @@ import ( func TestDefaultExplainRequestWithDockeyOnParentGroupBy(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) request with a dockey on parent groupBy.", + Description: "Explain (default) request with a docID on parent groupBy.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -30,7 +30,7 @@ func TestDefaultExplainRequestWithDockeyOnParentGroupBy(t *testing.T) { Request: `query @explain { Author( groupBy: [age], - dockey: "bae-6a4c5bc5-b044-5a03-a868-8260af6f2254" + docID: "bae-6a4c5bc5-b044-5a03-a868-8260af6f2254" ) { age _group { @@ -78,7 +78,7 @@ func TestDefaultExplainRequestWithDockeyOnParentGroupBy(t *testing.T) { func TestDefaultExplainRequestWithDockeysAndFilterOnParentGroupBy(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) request with dockeys and filter on parent groupBy.", + Description: "Explain (default) request with docIDs and filter on parent groupBy.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -89,7 +89,7 @@ func TestDefaultExplainRequestWithDockeysAndFilterOnParentGroupBy(t *testing.T) Author( groupBy: [age], filter: {age: {_eq: 20}}, - dockeys: [ + docIDs: [ "bae-6a4c5bc5-b044-5a03-a868-8260af6f2254", "bae-4ea9d148-13f3-5a48-a0ef-9ffd344caeed" ] diff --git a/tests/integration/explain/default/type_join_with_filter_and_key_test.go b/tests/integration/explain/default/type_join_with_filter_and_key_test.go index 010c8949ef..2dc2b7e91e 100644 --- a/tests/integration/explain/default/type_join_with_filter_and_key_test.go +++ b/tests/integration/explain/default/type_join_with_filter_and_key_test.go @@ -33,7 +33,7 @@ func TestDefaultExplainRequestWithRelatedAndRegularFilterAndKeys(t *testing.T) { name: {_eq: "John Grisham"}, books: {name: {_eq: "Painted House"}} }, - dockeys: [ + docIDs: [ "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d", "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f8e" ] @@ -120,7 +120,7 @@ func TestDefaultExplainRequestWithManyRelatedFiltersAndKey(t *testing.T) { articles: {name: {_eq: "To my dear readers"}}, books: {name: {_eq: "Theif Lord"}} }, - dockeys: ["bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d"] + docIDs: ["bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d"] ) { name age diff --git a/tests/integration/explain/default/with_filter_key_test.go b/tests/integration/explain/default/with_filter_key_test.go index 4d0ecd97bf..34edbbae3d 100644 --- a/tests/integration/explain/default/with_filter_key_test.go +++ b/tests/integration/explain/default/with_filter_key_test.go @@ -20,7 +20,7 @@ import ( func TestDefaultExplainRequestWithDocKeyFilter(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) request with dockey filter.", + Description: "Explain (default) request with docID filter.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -28,7 +28,7 @@ func TestDefaultExplainRequestWithDocKeyFilter(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain { - Author(dockey: "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d") { + Author(docID: "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d") { name age } @@ -72,7 +72,7 @@ func TestDefaultExplainRequestWithDocKeyFilter(t *testing.T) { func TestDefaultExplainRequestWithDocKeysFilterUsingOneKey(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) request with dockeys filter using one key.", + Description: "Explain (default) request with docIDs filter using one key.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -80,7 +80,7 @@ func TestDefaultExplainRequestWithDocKeysFilterUsingOneKey(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain { - Author(dockeys: ["bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d"]) { + Author(docIDs: ["bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d"]) { name age } @@ -124,7 +124,7 @@ func TestDefaultExplainRequestWithDocKeysFilterUsingOneKey(t *testing.T) { func TestDefaultExplainRequestWithDocKeysFilterUsingMultipleButDuplicateKeys(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) request with dockeys filter using multiple but duplicate keys.", + Description: "Explain (default) request with docIDs filter using multiple but duplicate keys.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -133,7 +133,7 @@ func TestDefaultExplainRequestWithDocKeysFilterUsingMultipleButDuplicateKeys(t * Request: `query @explain { Author( - dockeys: [ + docIDs: [ "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d", "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d" ] @@ -186,7 +186,7 @@ func TestDefaultExplainRequestWithDocKeysFilterUsingMultipleButDuplicateKeys(t * func TestDefaultExplainRequestWithDocKeysFilterUsingMultipleUniqueKeys(t *testing.T) { test := testUtils.TestCase{ - Description: "Explain (default) request with dockeys filter using multiple unique keys.", + Description: "Explain (default) request with docIDs filter using multiple unique keys.", Actions: []any{ explainUtils.SchemaForExplainTests, @@ -195,7 +195,7 @@ func TestDefaultExplainRequestWithDocKeysFilterUsingMultipleUniqueKeys(t *testin Request: `query @explain { Author( - dockeys: [ + docIDs: [ "bae-079d0bd8-4b1b-5f5f-bd95-4d915c277f9d", "bae-bfbfc89c-0d63-5ea4-81a3-3ebd295be67f" ] diff --git a/tests/integration/explain/execute/dagscan_test.go b/tests/integration/explain/execute/dagscan_test.go index 9b91ff5003..3edc6e71f0 100644 --- a/tests/integration/explain/execute/dagscan_test.go +++ b/tests/integration/explain/execute/dagscan_test.go @@ -30,7 +30,7 @@ func TestExecuteExplainCommitsDagScan(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain(type: execute) { - commits (dockey: "bae-7f54d9e0-cbde-5320-aa6c-5c8895a89138") { + commits (docID: "bae-7f54d9e0-cbde-5320-aa6c-5c8895a89138") { links { cid } @@ -75,7 +75,7 @@ func TestExecuteExplainLatestCommitsDagScan(t *testing.T) { testUtils.ExplainRequest{ Request: `query @explain(type: execute) { - latestCommits(dockey: "bae-7f54d9e0-cbde-5320-aa6c-5c8895a89138") { + latestCommits(docID: "bae-7f54d9e0-cbde-5320-aa6c-5c8895a89138") { cid links { cid diff --git a/tests/integration/mutation/delete/with_ids_txn_test.go b/tests/integration/mutation/delete/with_ids_txn_test.go index 5ab1f89396..c59ec5c262 100644 --- a/tests/integration/mutation/delete/with_ids_txn_test.go +++ b/tests/integration/mutation/delete/with_ids_txn_test.go @@ -56,7 +56,7 @@ func TestMutationDeletion_WithIDsAndTxn(t *testing.T) { testUtils.Request{ TransactionID: immutable.Some(0), Request: `query { - User(dockeys: ["bae-6a6482a8-24e1-5c73-a237-ca569e41507d"]) { + User(docIDs: ["bae-6a6482a8-24e1-5c73-a237-ca569e41507d"]) { _docID } }`, diff --git a/tests/integration/query/commits/with_dockey_cid_test.go b/tests/integration/query/commits/with_dockey_cid_test.go index 0cda06e63c..9f63f7fc2d 100644 --- a/tests/integration/query/commits/with_dockey_cid_test.go +++ b/tests/integration/query/commits/with_dockey_cid_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyAndCidForDifferentDoc(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and cid", + Description: "Simple all commits query with docID and cid", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -31,7 +31,7 @@ func TestQueryCommitsWithDockeyAndCidForDifferentDoc(t *testing.T) { testUtils.Request{ Request: ` { commits( - dockey: "bae-not-this-doc", + docID: "bae-not-this-doc", cid: "bafybeica4js2abwqjjrz7dcialbortbz32uxp7ufxu7yljbwvmhjqqxzny" ) { cid @@ -47,7 +47,7 @@ func TestQueryCommitsWithDockeyAndCidForDifferentDoc(t *testing.T) { func TestQueryCommitsWithDockeyAndCidForDifferentDocWithUpdate(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and cid", + Description: "Simple all commits query with docID and cid", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -67,7 +67,7 @@ func TestQueryCommitsWithDockeyAndCidForDifferentDocWithUpdate(t *testing.T) { testUtils.Request{ Request: ` { commits( - dockey: "bae-not-this-doc", + docID: "bae-not-this-doc", cid: "bafybeica4js2abwqjjrz7dcialbortbz32uxp7ufxu7yljbwvmhjqqxzny" ) { cid @@ -83,7 +83,7 @@ func TestQueryCommitsWithDockeyAndCidForDifferentDocWithUpdate(t *testing.T) { func TestQueryCommitsWithDockeyAndCid(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and cid", + Description: "Simple all commits query with docID and cid", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -103,7 +103,7 @@ func TestQueryCommitsWithDockeyAndCid(t *testing.T) { testUtils.Request{ Request: ` { commits( - dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", + docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", cid: "bafybeic4x7hxoh7yhqmvo7c3mqoyv6j7lnnajkt2hzf2j3mjaf6wmwwl6u" ) { cid diff --git a/tests/integration/query/commits/with_dockey_count_test.go b/tests/integration/query/commits/with_dockey_count_test.go index 0843cc68bc..c7f3ccfa76 100644 --- a/tests/integration/query/commits/with_dockey_count_test.go +++ b/tests/integration/query/commits/with_dockey_count_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyAndLinkCount(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple latest commits query with dockey and link count", + Description: "Simple latest commits query with docID and link count", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -30,7 +30,7 @@ func TestQueryCommitsWithDockeyAndLinkCount(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { cid _count(field: links) } diff --git a/tests/integration/query/commits/with_dockey_field_test.go b/tests/integration/query/commits/with_dockey_field_test.go index 3ce1db4227..611ed41e3c 100644 --- a/tests/integration/query/commits/with_dockey_field_test.go +++ b/tests/integration/query/commits/with_dockey_field_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyAndUnknownField(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and unknown field", + Description: "Simple all commits query with docID and unknown field", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -30,7 +30,7 @@ func TestQueryCommitsWithDockeyAndUnknownField(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "not a field") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "not a field") { cid } }`, @@ -44,7 +44,7 @@ func TestQueryCommitsWithDockeyAndUnknownField(t *testing.T) { func TestQueryCommitsWithDockeyAndUnknownFieldId(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and unknown field id", + Description: "Simple all commits query with docID and unknown field id", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -56,7 +56,7 @@ func TestQueryCommitsWithDockeyAndUnknownFieldId(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "999999") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "999999") { cid } }`, @@ -69,10 +69,10 @@ func TestQueryCommitsWithDockeyAndUnknownFieldId(t *testing.T) { } // This test is for documentation reasons only. This is not -// desired behaviour (should return all commits for dockey-field). +// desired behaviour (should return all commits for docID-field). func TestQueryCommitsWithDockeyAndField(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and field", + Description: "Simple all commits query with docID and field", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -84,7 +84,7 @@ func TestQueryCommitsWithDockeyAndField(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "Age") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "Age") { cid } }`, @@ -100,7 +100,7 @@ func TestQueryCommitsWithDockeyAndField(t *testing.T) { // desired behaviour (Users should not be specifying field ids). func TestQueryCommitsWithDockeyAndFieldId(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and field id", + Description: "Simple all commits query with docID and field id", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -112,7 +112,7 @@ func TestQueryCommitsWithDockeyAndFieldId(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "1") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "1") { cid } }`, @@ -132,7 +132,7 @@ func TestQueryCommitsWithDockeyAndFieldId(t *testing.T) { // desired behaviour (Users should not be specifying field ids). func TestQueryCommitsWithDockeyAndCompositeFieldId(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and field id", + Description: "Simple all commits query with docID and field id", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -144,7 +144,7 @@ func TestQueryCommitsWithDockeyAndCompositeFieldId(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "C") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "C") { cid } }`, diff --git a/tests/integration/query/commits/with_dockey_group_order_test.go b/tests/integration/query/commits/with_dockey_group_order_test.go index d29a3683ea..cb416fd6d4 100644 --- a/tests/integration/query/commits/with_dockey_group_order_test.go +++ b/tests/integration/query/commits/with_dockey_group_order_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsOrderedAndGroupedByDocKey(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query, grouped and ordered by dockey", + Description: "Simple all commits query, grouped and ordered by docID", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -37,16 +37,16 @@ func TestQueryCommitsOrderedAndGroupedByDocKey(t *testing.T) { }, testUtils.Request{ Request: ` { - commits(groupBy: [dockey], order: {dockey: DESC}) { - dockey + commits(groupBy: [docID], order: {docID: DESC}) { + docID } }`, Results: []map[string]any{ { - "dockey": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", + "docID": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", }, { - "dockey": "bae-72f3dc53-1846-55d5-915c-28c4e83cc891", + "docID": "bae-72f3dc53-1846-55d5-915c-28c4e83cc891", }, }, }, diff --git a/tests/integration/query/commits/with_dockey_limit_offset_test.go b/tests/integration/query/commits/with_dockey_limit_offset_test.go index e445dc6b42..e70a760cf6 100644 --- a/tests/integration/query/commits/with_dockey_limit_offset_test.go +++ b/tests/integration/query/commits/with_dockey_limit_offset_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyAndLimitAndOffset(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, limit and offset", + Description: "Simple all commits query with docID, limit and offset", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -51,7 +51,7 @@ func TestQueryCommitsWithDockeyAndLimitAndOffset(t *testing.T) { }, testUtils.Request{ Request: ` { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", limit: 2, offset: 1) { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", limit: 2, offset: 1) { cid } }`, diff --git a/tests/integration/query/commits/with_dockey_limit_test.go b/tests/integration/query/commits/with_dockey_limit_test.go index 355981b382..619d04c144 100644 --- a/tests/integration/query/commits/with_dockey_limit_test.go +++ b/tests/integration/query/commits/with_dockey_limit_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyAndLimit(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and limit", + Description: "Simple all commits query with docID and limit", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -44,7 +44,7 @@ func TestQueryCommitsWithDockeyAndLimit(t *testing.T) { }, testUtils.Request{ Request: ` { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", limit: 2) { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", limit: 2) { cid } }`, diff --git a/tests/integration/query/commits/with_dockey_order_limit_offset_test.go b/tests/integration/query/commits/with_dockey_order_limit_offset_test.go index e7b443f313..d0e18629fc 100644 --- a/tests/integration/query/commits/with_dockey_order_limit_offset_test.go +++ b/tests/integration/query/commits/with_dockey_order_limit_offset_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyAndOrderAndLimitAndOffset(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, order, limit and offset", + Description: "Simple all commits query with docID, order, limit and offset", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -51,7 +51,7 @@ func TestQueryCommitsWithDockeyAndOrderAndLimitAndOffset(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {height: ASC}, limit: 2, offset: 4) { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {height: ASC}, limit: 2, offset: 4) { cid height } diff --git a/tests/integration/query/commits/with_dockey_order_test.go b/tests/integration/query/commits/with_dockey_order_test.go index 5f11bd3469..31da302a01 100644 --- a/tests/integration/query/commits/with_dockey_order_test.go +++ b/tests/integration/query/commits/with_dockey_order_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyAndOrderHeightDesc(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, order height desc", + Description: "Simple all commits query with docID, order height desc", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -37,7 +37,7 @@ func TestQueryCommitsWithDockeyAndOrderHeightDesc(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {height: DESC}) { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {height: DESC}) { cid height } @@ -73,7 +73,7 @@ func TestQueryCommitsWithDockeyAndOrderHeightDesc(t *testing.T) { func TestQueryCommitsWithDockeyAndOrderHeightAsc(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, order height asc", + Description: "Simple all commits query with docID, order height asc", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -92,7 +92,7 @@ func TestQueryCommitsWithDockeyAndOrderHeightAsc(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {height: ASC}) { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {height: ASC}) { cid height } @@ -128,7 +128,7 @@ func TestQueryCommitsWithDockeyAndOrderHeightAsc(t *testing.T) { func TestQueryCommitsWithDockeyAndOrderCidDesc(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, order cid desc", + Description: "Simple all commits query with docID, order cid desc", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -147,7 +147,7 @@ func TestQueryCommitsWithDockeyAndOrderCidDesc(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {cid: DESC}) { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {cid: DESC}) { cid height } @@ -183,7 +183,7 @@ func TestQueryCommitsWithDockeyAndOrderCidDesc(t *testing.T) { func TestQueryCommitsWithDockeyAndOrderCidAsc(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, order cid asc", + Description: "Simple all commits query with docID, order cid asc", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -202,7 +202,7 @@ func TestQueryCommitsWithDockeyAndOrderCidAsc(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {cid: ASC}) { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {cid: ASC}) { cid height } @@ -238,7 +238,7 @@ func TestQueryCommitsWithDockeyAndOrderCidAsc(t *testing.T) { func TestQueryCommitsWithDockeyAndOrderAndMultiUpdatesCidAsc(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, multiple updates with order cid asc", + Description: "Simple all commits query with docID, multiple updates with order cid asc", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -271,7 +271,7 @@ func TestQueryCommitsWithDockeyAndOrderAndMultiUpdatesCidAsc(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {height: ASC}) { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", order: {height: ASC}) { cid height } diff --git a/tests/integration/query/commits/with_dockey_prop_test.go b/tests/integration/query/commits/with_dockey_prop_test.go index daf21ba1c7..030ec7376e 100644 --- a/tests/integration/query/commits/with_dockey_prop_test.go +++ b/tests/integration/query/commits/with_dockey_prop_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyProperty(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple commits query with dockey property", + Description: "Simple commits query with docID property", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -31,18 +31,18 @@ func TestQueryCommitsWithDockeyProperty(t *testing.T) { testUtils.Request{ Request: `query { commits { - dockey + docID } }`, Results: []map[string]any{ { - "dockey": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", + "docID": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", }, { - "dockey": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", + "docID": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", }, { - "dockey": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", + "docID": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", }, }, }, diff --git a/tests/integration/query/commits/with_dockey_test.go b/tests/integration/query/commits/with_dockey_test.go index f13d932ab4..7c7a434499 100644 --- a/tests/integration/query/commits/with_dockey_test.go +++ b/tests/integration/query/commits/with_dockey_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithUnknownDockey(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with unknown dockey", + Description: "Simple all commits query with unknown document ID", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -30,7 +30,7 @@ func TestQueryCommitsWithUnknownDockey(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "unknown dockey") { + commits(docID: "unknown document ID") { cid } }`, @@ -44,7 +44,7 @@ func TestQueryCommitsWithUnknownDockey(t *testing.T) { func TestQueryCommitsWithDockey(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey", + Description: "Simple all commits query with docID", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -56,7 +56,7 @@ func TestQueryCommitsWithDockey(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { cid } }`, @@ -80,7 +80,7 @@ func TestQueryCommitsWithDockey(t *testing.T) { func TestQueryCommitsWithDockeyAndLinks(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, with links", + Description: "Simple all commits query with docID, with links", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -92,7 +92,7 @@ func TestQueryCommitsWithDockeyAndLinks(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { cid links { cid @@ -132,7 +132,7 @@ func TestQueryCommitsWithDockeyAndLinks(t *testing.T) { func TestQueryCommitsWithDockeyAndUpdate(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, multiple results", + Description: "Simple all commits query with docID, multiple results", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -151,7 +151,7 @@ func TestQueryCommitsWithDockeyAndUpdate(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { cid height } @@ -190,7 +190,7 @@ func TestQueryCommitsWithDockeyAndUpdate(t *testing.T) { // includes link._Name). func TestQueryCommitsWithDockeyAndUpdateAndLinks(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey, multiple results and links", + Description: "Simple all commits query with docID, multiple results and links", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -209,7 +209,7 @@ func TestQueryCommitsWithDockeyAndUpdateAndLinks(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { cid links { cid diff --git a/tests/integration/query/commits/with_dockey_typename_test.go b/tests/integration/query/commits/with_dockey_typename_test.go index d5c96f8534..89c968b89f 100644 --- a/tests/integration/query/commits/with_dockey_typename_test.go +++ b/tests/integration/query/commits/with_dockey_typename_test.go @@ -18,7 +18,7 @@ import ( func TestQueryCommitsWithDockeyWithTypeName(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query with dockey and typename", + Description: "Simple all commits query with docID and typename", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -30,7 +30,7 @@ func TestQueryCommitsWithDockeyWithTypeName(t *testing.T) { }, testUtils.Request{ Request: `query { - commits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + commits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { cid __typename } diff --git a/tests/integration/query/commits/with_group_test.go b/tests/integration/query/commits/with_group_test.go index c9843059a0..e21258a129 100644 --- a/tests/integration/query/commits/with_group_test.go +++ b/tests/integration/query/commits/with_group_test.go @@ -175,7 +175,7 @@ func TestQueryCommitsWithGroupByCidWithChild(t *testing.T) { func TestQueryCommitsWithGroupByDocKey(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple all commits query, group by dockey", + Description: "Simple all commits query, group by document ID", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -208,16 +208,16 @@ func TestQueryCommitsWithGroupByDocKey(t *testing.T) { }, testUtils.Request{ Request: ` { - commits(groupBy: [dockey]) { - dockey + commits(groupBy: [docID]) { + docID } }`, Results: []map[string]any{ { - "dockey": "bae-72f3dc53-1846-55d5-915c-28c4e83cc891", + "docID": "bae-72f3dc53-1846-55d5-915c-28c4e83cc891", }, { - "dockey": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", + "docID": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", }, }, }, diff --git a/tests/integration/query/latest_commits/simple_test.go b/tests/integration/query/latest_commits/simple_test.go index 7a6e28f6d8..e31ee22da8 100644 --- a/tests/integration/query/latest_commits/simple_test.go +++ b/tests/integration/query/latest_commits/simple_test.go @@ -38,7 +38,7 @@ func TestQueryLatestCommits(t *testing.T) { }`, }, }, - ExpectedError: "Field \"latestCommits\" argument \"dockey\" of type \"ID!\" is required but not provided.", + ExpectedError: "Field \"latestCommits\" argument \"docID\" of type \"ID!\" is required but not provided.", } executeTestCase(t, test) diff --git a/tests/integration/query/latest_commits/with_collectionid_prop_test.go b/tests/integration/query/latest_commits/with_collectionid_prop_test.go index afdd6ae7ee..78ffab9b3c 100644 --- a/tests/integration/query/latest_commits/with_collectionid_prop_test.go +++ b/tests/integration/query/latest_commits/with_collectionid_prop_test.go @@ -37,7 +37,7 @@ func TestQueryLastCommitsWithCollectionIdProperty(t *testing.T) { }, testUtils.Request{ Request: `query { - latestCommits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + latestCommits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { collectionID } }`, @@ -49,7 +49,7 @@ func TestQueryLastCommitsWithCollectionIdProperty(t *testing.T) { }, testUtils.Request{ Request: `query { - latestCommits(dockey: "bae-de8c99bf-ee0e-5655-8a72-919c2d459a30") { + latestCommits(docID: "bae-de8c99bf-ee0e-5655-8a72-919c2d459a30") { collectionID } }`, diff --git a/tests/integration/query/latest_commits/with_dockey_field_test.go b/tests/integration/query/latest_commits/with_dockey_field_test.go index e11ca9fa6a..a8a04f8da2 100644 --- a/tests/integration/query/latest_commits/with_dockey_field_test.go +++ b/tests/integration/query/latest_commits/with_dockey_field_test.go @@ -20,9 +20,9 @@ import ( // desired behaviour (it looks totally broken to me). func TestQueryLatestCommitsWithDocKeyAndFieldName(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple latest commits query with dockey and field name", + Description: "Simple latest commits query with docID and field name", Request: `query { - latestCommits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "age") { + latestCommits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "age") { cid links { cid @@ -48,9 +48,9 @@ func TestQueryLatestCommitsWithDocKeyAndFieldName(t *testing.T) { // desired behaviour (Users should not be specifying field ids). func TestQueryLatestCommitsWithDocKeyAndFieldId(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple latest commits query with dockey and field id", + Description: "Simple latest commits query with docID and field id", Request: `query { - latestCommits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "1") { + latestCommits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "1") { cid links { cid @@ -81,9 +81,9 @@ func TestQueryLatestCommitsWithDocKeyAndFieldId(t *testing.T) { // desired behaviour (Users should not be specifying field ids). func TestQueryLatestCommitsWithDocKeyAndCompositeFieldId(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple latest commits query with dockey and composite field id", + Description: "Simple latest commits query with docID and composite field id", Request: `query { - latestCommits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "C") { + latestCommits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", fieldId: "C") { cid links { cid diff --git a/tests/integration/query/latest_commits/with_dockey_prop_test.go b/tests/integration/query/latest_commits/with_dockey_prop_test.go index b7ffd80d65..6a8eeabb6b 100644 --- a/tests/integration/query/latest_commits/with_dockey_prop_test.go +++ b/tests/integration/query/latest_commits/with_dockey_prop_test.go @@ -18,7 +18,7 @@ import ( func TestQueryLastCommitsWithDockeyProperty(t *testing.T) { test := testUtils.TestCase{ - Description: "Simple latest commits query with dockey property", + Description: "Simple latest commits query with docID property", Actions: []any{ updateUserCollectionSchema(), testUtils.CreateDoc{ @@ -30,13 +30,13 @@ func TestQueryLastCommitsWithDockeyProperty(t *testing.T) { }, testUtils.Request{ Request: `query { - latestCommits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { - dockey + latestCommits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + docID } }`, Results: []map[string]any{ { - "dockey": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", + "docID": "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7", }, }, }, diff --git a/tests/integration/query/latest_commits/with_dockey_test.go b/tests/integration/query/latest_commits/with_dockey_test.go index b496672c77..1ef6f0edba 100644 --- a/tests/integration/query/latest_commits/with_dockey_test.go +++ b/tests/integration/query/latest_commits/with_dockey_test.go @@ -18,9 +18,9 @@ import ( func TestQueryLatestCommitsWithDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple latest commits query with dockey", + Description: "Simple latest commits query with docID", Request: `query { - latestCommits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + latestCommits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { cid links { cid @@ -58,9 +58,9 @@ func TestQueryLatestCommitsWithDocKey(t *testing.T) { func TestQueryLatestCommitsWithDocKeyWithSchemaVersionIdField(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple latest commits query with dockey and schema versiion id field", + Description: "Simple latest commits query with docID and schema versiion id field", Request: `query { - latestCommits(dockey: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { + latestCommits(docID: "bae-f54b9689-e06e-5e3a-89b3-f3aee8e64ca7") { cid schemaVersionId } diff --git a/tests/integration/query/latest_commits/with_field_test.go b/tests/integration/query/latest_commits/with_field_test.go index 70c4635cd4..67ae607c47 100644 --- a/tests/integration/query/latest_commits/with_field_test.go +++ b/tests/integration/query/latest_commits/with_field_test.go @@ -39,7 +39,7 @@ func TestQueryLatestCommitsWithField(t *testing.T) { }`, }, }, - ExpectedError: "Field \"latestCommits\" argument \"dockey\" of type \"ID!\" is required but not provided.", + ExpectedError: "Field \"latestCommits\" argument \"docID\" of type \"ID!\" is required but not provided.", } executeTestCase(t, test) @@ -68,7 +68,7 @@ func TestQueryLatestCommitsWithFieldId(t *testing.T) { }`, }, }, - ExpectedError: "Field \"latestCommits\" argument \"dockey\" of type \"ID!\" is required but not provided.", + ExpectedError: "Field \"latestCommits\" argument \"docID\" of type \"ID!\" is required but not provided.", } executeTestCase(t, test) diff --git a/tests/integration/query/one_to_many/with_cid_dockey_test.go b/tests/integration/query/one_to_many/with_cid_dockey_test.go index bfa94357ad..b45331a219 100644 --- a/tests/integration/query/one_to_many/with_cid_dockey_test.go +++ b/tests/integration/query/one_to_many/with_cid_dockey_test.go @@ -20,11 +20,11 @@ import ( // desired behaviour (should just return empty). // func TestQueryOneToManyWithUnknownCidAndDocKey(t *testing.T) { // test := testUtils.RequestTestCase{ -// Description: "One-to-many relation query from one side with unknown cid and dockey", +// Description: "One-to-many relation query from one side with unknown cid and docID", // Request: `query { // Book ( // cid: "bafybeicgwjdyqyuntdop5ytpsfrqg5a4t2r25pfv6prfppl5ta5k5altca", -// dockey: "bae-fd541c25-229e-5280-b44b-e5c2af3e374d" +// docID: "bae-fd541c25-229e-5280-b44b-e5c2af3e374d" // ) { // name // author { @@ -65,11 +65,11 @@ import ( func TestQueryOneToManyWithCidAndDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "One-to-many relation query from one side with cid and dockey", + Description: "One-to-many relation query from one side with cid and docID", Request: `query { Book ( cid: "bafybeiagqehqmtyxzcdujrrwho5uf7lxsewnb2hjy2gilbod26m7ybhja4" - dockey: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" + docID: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" ) { name author { @@ -114,11 +114,11 @@ func TestQueryOneToManyWithCidAndDocKey(t *testing.T) { // to parent state). func TestQueryOneToManyWithChildUpdateAndFirstCidAndDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "One-to-many relation query from one side with child update and parent cid and dockey", + Description: "One-to-many relation query from one side with child update and parent cid and docID", Request: `query { Book ( cid: "bafybeiagqehqmtyxzcdujrrwho5uf7lxsewnb2hjy2gilbod26m7ybhja4", - dockey: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" + docID: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" ) { name author { @@ -170,11 +170,11 @@ func TestQueryOneToManyWithChildUpdateAndFirstCidAndDocKey(t *testing.T) { func TestQueryOneToManyWithParentUpdateAndFirstCidAndDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "One-to-many relation query from one side with parent update and parent cid and dockey", + Description: "One-to-many relation query from one side with parent update and parent cid and docID", Request: `query { Book ( cid: "bafybeiagqehqmtyxzcdujrrwho5uf7lxsewnb2hjy2gilbod26m7ybhja4", - dockey: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" + docID: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" ) { name rating @@ -226,11 +226,11 @@ func TestQueryOneToManyWithParentUpdateAndFirstCidAndDocKey(t *testing.T) { func TestQueryOneToManyWithParentUpdateAndLastCidAndDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "One-to-many relation query from one side with parent update and parent cid and dockey", + Description: "One-to-many relation query from one side with parent update and parent cid and docID", Request: `query { Book ( cid: "bafybeianxv6tvc4esjfh4aufbfv3skrpjd5djv5zl72xun43vvg27p326y", - dockey: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" + docID: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" ) { name rating diff --git a/tests/integration/query/one_to_many/with_dockey_test.go b/tests/integration/query/one_to_many/with_dockey_test.go index fd75677c1c..c5cd005006 100644 --- a/tests/integration/query/one_to_many/with_dockey_test.go +++ b/tests/integration/query/one_to_many/with_dockey_test.go @@ -18,12 +18,12 @@ import ( func TestQueryOneToManyWithChildDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "One-to-many relation query from one side with child dockey", + Description: "One-to-many relation query from one side with child docID", Request: `query { Author { name published ( - dockey: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" + docID: "bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d" ) { name } diff --git a/tests/integration/query/one_to_many/with_dockeys_test.go b/tests/integration/query/one_to_many/with_dockeys_test.go index 1c58e5947f..e334fcb767 100644 --- a/tests/integration/query/one_to_many/with_dockeys_test.go +++ b/tests/integration/query/one_to_many/with_dockeys_test.go @@ -18,12 +18,12 @@ import ( func TestQueryOneToManyWithChildDocKeys(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "One-to-many relation query from one side with child dockeys", + Description: "One-to-many relation query from one side with child docIDs", Request: `query { Author { name published ( - dockeys: ["bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d", "bae-4fb9e3e9-d1d3-5404-bf15-10e4c995d9ca"] + docIDs: ["bae-b9b83269-1f28-5c3b-ae75-3fb4c00d559d", "bae-4fb9e3e9-d1d3-5404-bf15-10e4c995d9ca"] ) { name } diff --git a/tests/integration/query/simple/with_cid_dockey_test.go b/tests/integration/query/simple/with_cid_dockey_test.go index f7eb6420f5..94c62e596f 100644 --- a/tests/integration/query/simple/with_cid_dockey_test.go +++ b/tests/integration/query/simple/with_cid_dockey_test.go @@ -18,11 +18,11 @@ import ( func TestQuerySimpleWithInvalidCidAndInvalidDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with invalid cid and invalid dockey", + Description: "Simple query with invalid cid and invalid docID", Request: `query { Users ( cid: "any non-nil string value - this will be ignored", - dockey: "invalid docKey" + docID: "invalid docID" ) { Name } @@ -45,11 +45,11 @@ func TestQuerySimpleWithInvalidCidAndInvalidDocKey(t *testing.T) { // desired behaviour (should just return empty). func TestQuerySimpleWithUnknownCidAndInvalidDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with unknown cid and invalid dockey", + Description: "Simple query with unknown cid and invalid docID", Request: `query { Users ( cid: "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", - dockey: "invalid docKey" + docID: "invalid docID" ) { Name } @@ -70,11 +70,11 @@ func TestQuerySimpleWithUnknownCidAndInvalidDocKey(t *testing.T) { func TestQuerySimpleWithCidAndDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with cid and dockey", + Description: "Simple query with cid and docID", Request: `query { Users ( cid: "bafybeigyyj2jvd4265aalvq6wctzz7jz36rluxrevlnx2hewvowlq672na", - dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" + docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" ) { Name } @@ -99,11 +99,11 @@ func TestQuerySimpleWithCidAndDocKey(t *testing.T) { func TestQuerySimpleWithUpdateAndFirstCidAndDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with (first) cid and dockey", + Description: "Simple query with (first) cid and docID", Request: `query { Users ( cid: "bafybeigyyj2jvd4265aalvq6wctzz7jz36rluxrevlnx2hewvowlq672na", - dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" + docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" ) { Name Age @@ -140,11 +140,11 @@ func TestQuerySimpleWithUpdateAndFirstCidAndDocKey(t *testing.T) { func TestQuerySimpleWithUpdateAndLastCidAndDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with (last) cid and dockey", + Description: "Simple query with (last) cid and docID", Request: `query { Users ( cid: "bafybeihldrl36evcdi23igf3zjimmduhd65cgbnu25k5kw74yppou5x37a" - dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" + docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" ) { Name Age @@ -181,11 +181,11 @@ func TestQuerySimpleWithUpdateAndLastCidAndDocKey(t *testing.T) { func TestQuerySimpleWithUpdateAndMiddleCidAndDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with (middle) cid and dockey", + Description: "Simple query with (middle) cid and docID", Request: `query { Users ( cid: "bafybeidc7zcwnhto3pvsrtph3txv57no5xdjrca4jv5dzzacuedkr2osmm", - dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" + docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" ) { Name Age @@ -222,11 +222,11 @@ func TestQuerySimpleWithUpdateAndMiddleCidAndDocKey(t *testing.T) { func TestQuerySimpleWithUpdateAndFirstCidAndDocKeyAndSchemaVersion(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with (first) cid and dockey and yielded schema version", + Description: "Simple query with (first) cid and docID and yielded schema version", Request: `query { Users ( cid: "bafybeigyyj2jvd4265aalvq6wctzz7jz36rluxrevlnx2hewvowlq672na", - dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" + docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" ) { Name Age diff --git a/tests/integration/query/simple/with_dockey_test.go b/tests/integration/query/simple/with_dockey_test.go index 5af4dac7ab..1b3e00f83e 100644 --- a/tests/integration/query/simple/with_dockey_test.go +++ b/tests/integration/query/simple/with_dockey_test.go @@ -19,9 +19,9 @@ import ( func TestQuerySimpleWithDocKeyFilter(t *testing.T) { tests := []testUtils.RequestTestCase{ { - Description: "Simple query with basic filter (key by DocKey arg)", + Description: "Simple query with basic filter (key by docID arg)", Request: `query { - Users(dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f") { + Users(docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f") { Name Age } @@ -42,9 +42,9 @@ func TestQuerySimpleWithDocKeyFilter(t *testing.T) { }, }, { - Description: "Simple query with basic filter (key by DocKey arg), no results", + Description: "Simple query with basic filter (key by docID arg), no results", Request: `query { - Users(dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009g") { + Users(docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009g") { Name Age } @@ -60,9 +60,9 @@ func TestQuerySimpleWithDocKeyFilter(t *testing.T) { Results: []map[string]any{}, }, { - Description: "Simple query with basic filter (key by DocKey arg), partial results", + Description: "Simple query with basic filter (key by docID arg), partial results", Request: `query { - Users(dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f") { + Users(docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f") { Name Age } diff --git a/tests/integration/query/simple/with_dockeys_test.go b/tests/integration/query/simple/with_dockeys_test.go index 8bbd0067da..07afa14b3f 100644 --- a/tests/integration/query/simple/with_dockeys_test.go +++ b/tests/integration/query/simple/with_dockeys_test.go @@ -19,9 +19,9 @@ import ( func TestQuerySimpleWithDocKeysFilter(t *testing.T) { tests := []testUtils.RequestTestCase{ { - Description: "Simple query with basic filter (single key by DocKeys arg)", + Description: "Simple query with basic filter (single key by docIDs arg)", Request: `query { - Users(dockeys: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009f"]) { + Users(docIDs: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009f"]) { Name Age } @@ -42,9 +42,9 @@ func TestQuerySimpleWithDocKeysFilter(t *testing.T) { }, }, { - Description: "Simple query with basic filter (single key by DocKeys arg), no results", + Description: "Simple query with basic filter (single key by docIDs arg), no results", Request: `query { - Users(dockeys: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009g"]) { + Users(docIDs: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009g"]) { Name Age } @@ -60,9 +60,9 @@ func TestQuerySimpleWithDocKeysFilter(t *testing.T) { Results: []map[string]any{}, }, { - Description: "Simple query with basic filter (duplicate key by DocKeys arg), partial results", + Description: "Simple query with basic filter (duplicate key by docIDs arg), partial results", Request: `query { - Users(dockeys: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009f", "bae-52b9170d-b77a-5887-b877-cbdbb99b009f"]) { + Users(docIDs: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009f", "bae-52b9170d-b77a-5887-b877-cbdbb99b009f"]) { Name Age } @@ -87,9 +87,9 @@ func TestQuerySimpleWithDocKeysFilter(t *testing.T) { }, }, { - Description: "Simple query with basic filter (multiple key by DocKeys arg), partial results", + Description: "Simple query with basic filter (multiple key by docIDs arg), partial results", Request: `query { - Users(dockeys: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009f", "bae-1378ab62-e064-5af4-9ea6-49941c8d8f94"]) { + Users(docIDs: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009f", "bae-1378ab62-e064-5af4-9ea6-49941c8d8f94"]) { Name Age } @@ -130,9 +130,9 @@ func TestQuerySimpleWithDocKeysFilter(t *testing.T) { func TestQuerySimpleReturnsNothinGivenEmptyDocKeysFilter(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with empty DocKeys arg", + Description: "Simple query with empty docIDs arg", Request: `query { - Users(dockeys: []) { + Users(docIDs: []) { Name Age } diff --git a/tests/integration/query/simple/with_group_dockey_test.go b/tests/integration/query/simple/with_group_dockey_test.go index c40a27efc2..efa02ca52a 100644 --- a/tests/integration/query/simple/with_group_dockey_test.go +++ b/tests/integration/query/simple/with_group_dockey_test.go @@ -18,11 +18,11 @@ import ( func TestQuerySimpleWithGroupByWithGroupWithDocKey(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with DocKey filter on _group", + Description: "Simple query with docID filter on _group", Request: `query { Users(groupBy: [Age]) { Age - _group(dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f") { + _group(docID: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f") { Name } } diff --git a/tests/integration/query/simple/with_group_dockeys_test.go b/tests/integration/query/simple/with_group_dockeys_test.go index 8d11607819..5962139c80 100644 --- a/tests/integration/query/simple/with_group_dockeys_test.go +++ b/tests/integration/query/simple/with_group_dockeys_test.go @@ -18,11 +18,11 @@ import ( func TestQuerySimpleWithGroupByWithGroupWithDocKeys(t *testing.T) { test := testUtils.RequestTestCase{ - Description: "Simple query with DocKeys filter on _group", + Description: "Simple query with docIDs filter on _group", Request: `query { Users(groupBy: [Age]) { Age - _group(dockeys: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009f", "bae-9b2e1434-9d61-5eb1-b3b9-82e8e40729a7"]) { + _group(docIDs: ["bae-52b9170d-b77a-5887-b877-cbdbb99b009f", "bae-9b2e1434-9d61-5eb1-b3b9-82e8e40729a7"]) { Name } } diff --git a/tests/integration/query/simple/with_version_test.go b/tests/integration/query/simple/with_version_test.go index 7d990074a8..867cd26213 100644 --- a/tests/integration/query/simple/with_version_test.go +++ b/tests/integration/query/simple/with_version_test.go @@ -101,16 +101,16 @@ func TestQuerySimpleWithEmbeddedLatestCommitWithSchemaVersionId(t *testing.T) { } func TestQuerySimpleWithEmbeddedLatestCommitWithDockey(t *testing.T) { - const dockey = "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" + const docID = "bae-52b9170d-b77a-5887-b877-cbdbb99b009f" test := testUtils.RequestTestCase{ - Description: "Embedded commits query within object query with dockey", + Description: "Embedded commits query within object query with document ID", Request: `query { Users { Name _docID _version { - dockey + docID } } }`, @@ -125,10 +125,10 @@ func TestQuerySimpleWithEmbeddedLatestCommitWithDockey(t *testing.T) { Results: []map[string]any{ { "Name": "John", - "_docID": dockey, + "_docID": docID, "_version": []map[string]any{ { - "dockey": dockey, + "docID": docID, }, }, }, diff --git a/tests/integration/schema/default_fields.go b/tests/integration/schema/default_fields.go index 41e9e89551..79a3f6a8c8 100644 --- a/tests/integration/schema/default_fields.go +++ b/tests/integration/schema/default_fields.go @@ -10,7 +10,11 @@ package schema -import "sort" +import ( + "sort" + + "github.com/sourcenetwork/defradb/client/request" +) type Field = map[string]any type fields []Field @@ -130,14 +134,14 @@ var cidArg = Field{ }, } var dockeyArg = Field{ - "name": "dockey", + "name": request.DocID, "type": map[string]any{ "name": "String", "inputFields": nil, }, } var dockeysArg = Field{ - "name": "dockeys", + "name": request.DocID, "type": map[string]any{ "name": nil, "inputFields": nil, diff --git a/tests/integration/schema/migrations/query/with_dockey_test.go b/tests/integration/schema/migrations/query/with_dockey_test.go index c5c5a868f5..809da96f4c 100644 --- a/tests/integration/schema/migrations/query/with_dockey_test.go +++ b/tests/integration/schema/migrations/query/with_dockey_test.go @@ -69,7 +69,7 @@ func TestSchemaMigrationQueryByDocKey(t *testing.T) { }, testUtils.Request{ Request: `query { - Users (dockey: "bae-d7546ac1-c133-5853-b866-9b9f926fe7e5") { + Users (docID: "bae-d7546ac1-c133-5853-b866-9b9f926fe7e5") { name verified } @@ -88,7 +88,7 @@ func TestSchemaMigrationQueryByDocKey(t *testing.T) { } // This test asserts that lenses are being correctly returned to the pool for reuse after -// fetch completion. Querying by dockey should mean that the fetcher only scans the dockey +// fetch completion. Querying by docID should mean that the fetcher only scans the docID // prefix, and thus will only migrate a single document per query (unlike filters etc which // will migrate all documents at the time of writing). If the return mechanic was very faulty // then this test *should* deadlock. @@ -175,7 +175,7 @@ func TestSchemaMigrationQueryMultipleQueriesByDocKey(t *testing.T) { }, testUtils.Request{ Request: `query { - Users (dockey: "bae-d7546ac1-c133-5853-b866-9b9f926fe7e5") { + Users (docID: "bae-d7546ac1-c133-5853-b866-9b9f926fe7e5") { name verified } @@ -189,7 +189,7 @@ func TestSchemaMigrationQueryMultipleQueriesByDocKey(t *testing.T) { }, testUtils.Request{ Request: `query { - Users (dockey: "bae-92393ad0-07b6-5753-8dbb-19c9c41374ed") { + Users (docID: "bae-92393ad0-07b6-5753-8dbb-19c9c41374ed") { name verified } @@ -203,7 +203,7 @@ func TestSchemaMigrationQueryMultipleQueriesByDocKey(t *testing.T) { }, testUtils.Request{ Request: `query { - Users (dockey: "bae-403d7337-f73e-5c81-8719-e853938c8985") { + Users (docID: "bae-403d7337-f73e-5c81-8719-e853938c8985") { name verified } @@ -217,7 +217,7 @@ func TestSchemaMigrationQueryMultipleQueriesByDocKey(t *testing.T) { }, testUtils.Request{ Request: `query { - Users (dockey: "bae-decf6467-4c7c-50d7-b09d-0a7097ef6bad") { + Users (docID: "bae-decf6467-4c7c-50d7-b09d-0a7097ef6bad") { name verified } @@ -231,7 +231,7 @@ func TestSchemaMigrationQueryMultipleQueriesByDocKey(t *testing.T) { }, testUtils.Request{ Request: `query { - Users (dockey: "bae-3f1174ba-d9bc-5a6a-b0bc-8f19581f199d") { + Users (docID: "bae-3f1174ba-d9bc-5a6a-b0bc-8f19581f199d") { name verified } @@ -245,7 +245,7 @@ func TestSchemaMigrationQueryMultipleQueriesByDocKey(t *testing.T) { }, testUtils.Request{ Request: `query { - Users (dockey: "bae-0698bda7-2c69-5028-a26a-0a1c491b793b") { + Users (docID: "bae-0698bda7-2c69-5028-a26a-0a1c491b793b") { name verified }