TypeError: query.trim is not a function
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am trying to use graphql.js inside the Google Cloud Functions to query my database through a Graphql interface.
However when I try to set the URL, I get this error:
```
textPayload: "TypeError: query.trim is not a function
at Object.helper (/srv/node_modules/graphql.js/graphql.js:425:80)
at GraphQLClient.that.(anonymous function) [as query] (/srv/node_modules/graphql.js/graphql.js:442:23)
at listAggregators (/srv/lib/intents/location-permission.js:17:54)
```
Here is my code:
```
const graphql = require('graphql.js');
function listAggregators(conv: DialogflowConversation) {
const graph = graphql('https://graphql.staging.mygraphq.com/graphql');
// [...]
}
```
Should I set some extra parameters here?
Note: I am using typescript, instead of javascript. Maybe there is some compiler option that I should set, because I also get a compile error when I try to use `import` instead of `require` in `import graphql from 'graphql.js';`
Thanks,
Komyg
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.