Skip to content

Commit

Permalink
Document issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Sep 26, 2024
1 parent 418d3b2 commit 2905775
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/integration/schema/updates/add/field/with_relation_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2024 Democratized Data Foundation
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

package field

import (
"testing"

testUtils "github.com/sourcenetwork/defradb/tests/integration"
)

func TestSchemaUpdatesAddField_DoesNotAffectExistingRelation(t *testing.T) {
test := testUtils.TestCase{
Actions: []any{
testUtils.SchemaUpdate{
Schema: `
type Book {
name: String
author: Author
}
type Author {
name: String
books: [Book]
}
`,
},
testUtils.SchemaPatch{
Patch: `
[
{ "op": "add", "path": "/Book/Fields/-", "value": {"Name": "rating", "Kind": 4} }
]
`,
ExpectedError: "mutating an existing field is not supported.",
},
},
}
testUtils.ExecuteTestCase(t, test)
}

0 comments on commit 2905775

Please sign in to comment.