Skip to content

Commit

Permalink
Ignore graphql-server TS errors (redwoodjs#3126)
Browse files Browse the repository at this point in the history
* Ignore TS errors.

* Add graphql-server to tsconfig.
  • Loading branch information
peterp authored Jul 26, 2021
1 parent 3e1d823 commit a1fe889
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
47 changes: 27 additions & 20 deletions packages/graphql-server/src/functions/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,28 +372,35 @@ const useRedwoodLogger = (
onExecuteDone({ result }) {
const options = {} as any

if (includeData) {
options['data'] = result.data
}

if (result.errors && result.errors.length > 0) {
envelopLogger.error(
{
errors: result.errors,
},
`GraphQL execution completed with errors:`
)
} else {
if (includeTracing) {
options['tracing'] = result.extensions?.envelopTracing
// @ts-expect-error: Do not know where this is typed.
if (result.data) {
if (includeData) {
// @ts-expect-error: Do not know where this is typed.
options['data'] = result.data
}

envelopLogger.info(
{
...options,
},
`GraphQL execution completed`
)
// @ts-expect-error: Do not know where this is typed.
if (result.errors && result.errors.length > 0) {
envelopLogger.error(
{
// @ts-expect-error: Do not know where this is typed.
errors: result.errors,
},
`GraphQL execution completed with errors:`
)
} else {
if (includeTracing) {
// @ts-expect-error: Do not know where this is typed.
options['tracing'] = result.extensions?.envelopTracing
}

envelopLogger.info(
{
...options,
},
`GraphQL execution completed`
)
}
}
},
}
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{ "path": "packages/router" },
{ "path": "packages/testing" },
{ "path": "packages/prerender" },
{ "path": "packages/graphql-server" },
],
"files": []
}

0 comments on commit a1fe889

Please sign in to comment.