-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Timestamp" scalar type for convinience
* rm unnecessary files
- Loading branch information
1 parent
d07020a
commit 49bfabe
Showing
5 changed files
with
48 additions
and
53 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,32 @@ | ||
// @flow | ||
|
||
import { GraphQLScalarType } from 'graphql'; | ||
import { Kind } from 'graphql/language'; | ||
|
||
export const schema = [ | ||
` | ||
# GraphQL cannot handle long - normal timestamp will go failed. | ||
# In that case, use Timestamp. | ||
type Timestamp | ||
`, | ||
]; | ||
|
||
export const resolvers = { | ||
Timestamp: new GraphQLScalarType({ | ||
name: 'Timestamp', | ||
description: 'Timestamp custom scalar type', | ||
parseValue(value) { | ||
return value; | ||
}, | ||
serialize(value) { | ||
return value; | ||
}, | ||
parseLiteral(ast) { | ||
if (ast.kind === Kind.INT) { | ||
return ast.value; | ||
} | ||
return null; | ||
}, | ||
}), | ||
}; |
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 @@ | ||
import merge from 'lodash.merge'; | ||
|
||
/** * Queries ** */ | ||
|
||
export const schema = [...GetAllReactJSNews]; | ||
|
||
export const queries = [...GetAllReactJSNewsQueries]; | ||
|
||
export const resolvers = merge(GetAllReactJSNewsResolver); |
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.