Skip to content

Commit

Permalink
Update error (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto authored Nov 18, 2024
1 parent 242adad commit 4076574
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docker_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Changelog for the npm version are [here](/CHANGELOG.md).

## [Unreleased]

### Added

- Updated error when there's duplicate names in generated GraphQL Schema (#1857)

## [0.2.0-alpha.9] - 2024-11-11

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion internal/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ func (s *Schema) loadExistingEdges() (*assocEdgeData, error) {
// ExposeToGraphQL() bool
func (s *Schema) addGQLType(name string) error {
if s.gqlTypeMap[name] {
return fmt.Errorf("there's already an entity with GraphQL name %s", name)
return fmt.Errorf("there's already an entity with GraphQL name %s. Maybe Node and Pattern with the same name?", name)
}
s.gqlTypeMap[name] = true
return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/schema/schema_input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,7 @@ func TestDuplicateNames(t *testing.T) {

schema, err := schema.ParseFromInputSchema(&codegenapi.DummyConfig{}, inputSchema, base.GoLang)
require.Nil(t, schema)
require.Equal(t, err.Error(), "there's already an entity with GraphQL name ProfileType")
require.Equal(t, err.Error(), "there's already an entity with GraphQL name ProfileType. Maybe Node and Pattern with the same name?")
}

func TestMultipleActionsHiddenFromGraphQL(t *testing.T) {
Expand Down

0 comments on commit 4076574

Please sign in to comment.