forked from shurcooL/graphql
-
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.
Allow specifying GraphQL type for a particular type (shurcooL#33)
Co-authored-by: Nizar Malangadan <[email protected]>
- Loading branch information
Showing
3 changed files
with
69 additions
and
2 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package graphql | ||
|
||
// GraphQLType interface is used to specify the GraphQL type associated | ||
// with a particular type. If a type implements this interface, the name of | ||
// the variable used while creating the GraphQL query will be the output of | ||
// the function defined below. | ||
// | ||
// In the current implementation, the GetGraphQLType function is applied to | ||
// the zero value of the type to get the GraphQL type. So those who are | ||
// implementing the function should avoid referencing the value of the type | ||
// inside the function. Further, by this design, the output of the GetGraphQLType | ||
// function will be a constant. | ||
type GraphQLType interface { | ||
GetGraphQLType() string | ||
} |