Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fast-json-stringify and allows customJSONSerializer to be a function #88

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ Compiles the `document` AST, using an optional operationName and compiler option
so this option should only be set to true if there are strong assurances that the values are valid.
- `customSerializers` {Object as Map, default: {}} - Replace serializer functions for specific types. Can be used as a safer alternative
for overly expensive serializers
- `customJSONSerializer` {boolean, default: false} - Whether to produce also a JSON serializer function using `fast-json-stringify`. The default stringifier function is `JSON.stringify`
- `customJSONSerializer` {function, default: undefined} - A function to be called with [`CompilationContext`](https://github.com/zalando-incubator/graphql-jit/blob/master/src/execution.ts#L87) to produce also a JSON serializer function. The default stringifier function is `JSON.stringify`

#### compiledQuery.compiled(root: any, context: any, variables: Maybe<{ [key: string]: any }>)

the compiled function that can be called with a root value, a context and the required variables.

#### compiledQuery.stringify(value: any)

the compiled function for producing a JSON string. It will be `JSON.stringify` unless `compilerOptions.customJSONSerializer` is true.
The value argument should the return of the compiled GraphQL function.
the compiled function for producing a JSON string. It will be `JSON.stringify` unless `compilerOptions.customJSONSerializer` is a function.
The value argument should be the return of the compiled GraphQL function.

## LICENSE

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
"@stryker-mutator/typescript": "^2.0.0",
"@types/benchmark": "^1.0.31",
"@types/jest": "^24.0.11",
"@types/json-schema": "^7.0.1",
"@types/lodash.memoize": "^4.1.6",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.mergewith": "^4.6.6",
"@types/node": "^10.17.26",
"benchmark": "^2.1.4",
"codecov": "^3.3.0",
"fast-json-stringify": "^2.2.3",
"graphql": "^15.1.0",
"@graphql-tools/schema": "^6.0.10",
"jest": "^24.7.1",
Expand All @@ -74,9 +74,7 @@
"typescript": "^3.9.5"
},
"dependencies": {
"fast-json-stringify": "^1.13.0",
"generate-function": "^2.3.1",
"json-schema": "^0.2.3",
"lodash.memoize": "^4.1.2",
"lodash.merge": "4.6.2",
"lodash.mergewith": "4.6.2"
Expand Down
173 changes: 0 additions & 173 deletions src/__tests__/__snapshots__/json.test.ts.snap

This file was deleted.

Loading