Skip to content

Commit

Permalink
support JSON in graphql options
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Oct 25, 2023
1 parent 6131325 commit 75ce709
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/datasources/GraphQL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,13 @@ export default class GraphQL extends Backbone.Model<GraphQLOptions> implements I
Object
.keys(tree.token.options)
.map(key => ({key, value: tree.token.options![key]}))
.filter(({value}) => !!value)
.map(({key, value}) => typeof value === 'string' && !isJson(value) ? `${key}: "${value}"` : `${key}: ${value}`)
.join(', ')
})` : ''
// The query
return dedent`${indent}${tree.token.fieldId}${args} {
__typename
${children}
${indent}}`
}
Expand Down

0 comments on commit 75ce709

Please sign in to comment.