Hello! I have a question about `graphql-request`: ...
# orm-help
h
Hello! I have a question about `graphql-request`: how can I import a query from a
my-query.graphql
file?
c
To understand correctly. You'd like to do something like:
Copy code
import { request } from 'graphql-request'
import MyQuery from './MyQuery'

request('<https://api.graph.cool/simple/v1/movies>', MyQuery).then(data => console.log(data))
?
h
Yeah. I have my queries in
*.graphql
files and I generate TypeScript types from them, but I need to rewrite them (or import with
fs.readFileSync
). I wonder if there is a better method simple smile
c
Check this: https://github.com/prisma/graphql-import. It might work
👍 1