-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'graphql:main' into fragment-args-2023
- Loading branch information
Showing
5 changed files
with
110 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const viralSDL = `\ | ||
schema { | ||
query: Query | ||
} | ||
type Query { | ||
viruses: [Virus!] | ||
} | ||
type Virus { | ||
name: String! | ||
knownMutations: [Mutation!]! | ||
} | ||
type Mutation { | ||
name: String! | ||
geneSequence: String! | ||
}\ | ||
`; |
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,44 @@ | ||
import { | ||
GraphQLList, | ||
GraphQLNonNull, | ||
GraphQLObjectType, | ||
} from '../type/definition.js'; | ||
import { GraphQLString } from '../type/scalars.js'; | ||
import { GraphQLSchema } from '../type/schema.js'; | ||
|
||
const Mutation = new GraphQLObjectType({ | ||
name: 'Mutation', | ||
fields: { | ||
name: { | ||
type: new GraphQLNonNull(GraphQLString), | ||
}, | ||
geneSequence: { | ||
type: new GraphQLNonNull(GraphQLString), | ||
}, | ||
}, | ||
}); | ||
|
||
const Virus = new GraphQLObjectType({ | ||
name: 'Virus', | ||
fields: { | ||
name: { | ||
type: new GraphQLNonNull(GraphQLString), | ||
}, | ||
knownMutations: { | ||
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Mutation))), | ||
}, | ||
}, | ||
}); | ||
|
||
const Query = new GraphQLObjectType({ | ||
name: 'Query', | ||
fields: { | ||
viruses: { | ||
type: new GraphQLList(new GraphQLNonNull(Virus)), | ||
}, | ||
}, | ||
}); | ||
|
||
export const viralSchema = new GraphQLSchema({ | ||
query: Query, | ||
}); |
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 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 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