Skip to content

Commit

Permalink
chore(test): add union type in test schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayank1791989 committed May 15, 2017
1 parent a853032 commit c7bb3f3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/__test-data__/schema/query.gql
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ type NewPlayer {
image(role: Role): string
friend: Node!
}

union Entity = Team | Player
15 changes: 15 additions & 0 deletions src/__test-data__/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ export function getDefLocations() {
export function getRefLocations() {
return {
Player: [
{
start: { line: 40, column: 23 },
end: { line: 40, column: 29 },
path: path.resolve('src/__test-data__/schema/query.gql'),
},
{
start: { line: 14, column: 11 },
end: { line: 14, column: 17 },
Expand Down Expand Up @@ -261,6 +266,11 @@ export function getHints() {
text: 'NewPlayer',
type: 'Object',
},
{
description: '',
text: 'Entity',
type: 'Union',
},
{
description: '',
text: 'CustomScalar',
Expand Down Expand Up @@ -339,6 +349,11 @@ export function getHints() {
text: 'NewPlayer',
type: 'Object',
},
{
description: '',
text: 'Entity',
type: 'Union',
},
],

InputTypes: [
Expand Down
1 change: 1 addition & 0 deletions src/shared/GQLTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const typeName = {
GraphQLScalarType: 'Scalar', // native scalar types

GQLInterfaceType: 'Interface',
GQLUnionType: 'Union',
};

function memoize<T>(fn: T): T {
Expand Down

0 comments on commit c7bb3f3

Please # to comment.