-
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.
... for github action to include it the package + expect String Kind + rejection test + version
- Loading branch information
Mr D
committed
Jul 2, 2020
1 parent
d2ded7e
commit e474a16
Showing
6 changed files
with
56 additions
and
8 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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
**/.vscode/* | ||
**/node_modules/* | ||
**/coverage/* | ||
**/cjs/* | ||
*.tgz | ||
*.zip | ||
*.tar.gz | ||
|
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,3 @@ | ||
declare var _default: GraphQLScalarType; | ||
export default _default; | ||
import { GraphQLScalarType } from "graphql"; |
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,27 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const graphql_1 = require("graphql"); | ||
const language_1 = require("graphql/language"); | ||
const json5_1 = __importDefault(require("json5")); | ||
/** */ | ||
exports.default = new graphql_1.GraphQLScalarType({ | ||
name: "JSON5", | ||
description: "`JSON5` scalar type, see [JSON5](https://spec.json5.org).", | ||
serialize: json5_1.default.stringify, | ||
parseValue: json5_1.default.parse, | ||
/** | ||
* @param {import("graphql").ASTNode | any} ast | ||
*/ | ||
parseLiteral: (ast, variables) => { | ||
switch (ast.kind) { | ||
case language_1.Kind.VARIABLE: | ||
return ((variables && json5_1.default.parse(variables[ast.name.value])) || undefined); | ||
default: { | ||
return json5_1.default.parse(ast.value); | ||
} | ||
} | ||
}, | ||
}); |
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