forked from 99designs/gqlgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving federation tests to their own folders
Reorganizing the tests in the federation plugin a little bit so make it simpler to add more safely without testdata colliding. This is in anticipation for a follow up PR for adding entity resolver tests. Run the tests with `go test ./plugin/federation/...` and verify they all pass. Also verify that the testdata/allthething directory has a `generated` directory specific to that test. NOTE: There is a catch all type of test that I moved to the directory `allthething`. Open to suggestions for a better name! One potential thing to considere here is to split up the tests that use that testdata and break them down into more specific tests. E.g. Add a multikey test in the testdata/entity. For now, Im leaving that as a TODO.
- Loading branch information
1 parent
b7db36d
commit 95cb68e
Showing
8 changed files
with
66 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
schema: | ||
- "testdata/allthethings/schema.graphql" | ||
exec: | ||
filename: testdata/allthethings/generated/exec.go | ||
federation: | ||
filename: testdata/allthethings/generated/federation.go | ||
|
||
autobind: | ||
- "github.com/99designs/gqlgen/plugin/federation/testdata/allthethings/model" |
48 changes: 48 additions & 0 deletions
48
plugin/federation/testdata/allthethings/model/federation.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package model | ||
|
||
type _FieldSet string //nolint:deadcode,unused | ||
|
||
type Hello struct { | ||
Name string | ||
Secondary string | ||
} | ||
|
||
func (Hello) IsEntity() {} | ||
|
||
type World struct { | ||
Foo string | ||
Bar int | ||
} | ||
|
||
func (World) IsEntity() {} | ||
|
||
type ExternalExtension struct { | ||
UPC string | ||
Reviews []*World | ||
} | ||
|
||
func (ExternalExtension) IsEntity() {} | ||
|
||
type NestedKey struct { | ||
ID string | ||
Hello *Hello | ||
} | ||
|
||
func (NestedKey) IsEntity() {} | ||
|
||
type MoreNesting struct { | ||
ID string | ||
World *World | ||
} | ||
|
||
func (MoreNesting) IsEntity() {} | ||
|
||
type VeryNestedKey struct { | ||
ID string | ||
Hello *Hello | ||
World *World | ||
Nested *NestedKey | ||
More *MoreNesting | ||
} | ||
|
||
func (VeryNestedKey) IsEntity() {} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
schema: | ||
- "testdata/entities/nokey.graphql" | ||
exec: | ||
filename: testdata/entities/generated/exec.go | ||
federation: | ||
filename: testdata/entities/generated/federation.go |