https://github.com/crewdevio/importql
easy way to import and parse graphql files 🎡
https://github.com/crewdevio/importql
deno denoland graphql parse-graphql-files typescript
Last synced: 5 months ago
JSON representation
easy way to import and parse graphql files 🎡
- Host: GitHub
- URL: https://github.com/crewdevio/importql
- Owner: crewdevio
- License: mit
- Created: 2020-06-20T23:28:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-04T20:59:33.000Z (about 5 years ago)
- Last Synced: 2025-09-26T12:31:50.639Z (6 months ago)
- Topics: deno, denoland, graphql, parse-graphql-files, typescript
- Language: TypeScript
- Homepage:
- Size: 3.91 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IMPORTQL 🎡
easy way to import and parse graphql files in [deno](https://deno.land/)

## install
install using [Trex](https://deno.land/x/trex) package manager
```sh
$ trex install --map importql
```
or use url
```javascript
import { importQL } from "https://deno.land/x/importql/mod.ts";
```
## use
```graphql
# query.graphql file
type User {
firstName: String
lastName: String
}
input UserInput {
firstName: String
lastName: String
}
type ResolveType {
done: Boolean
}
type Query {
getUser(id: String): User
}
type Mutation {
setUser(input: UserInput!): ResolveType!
}
```
```javascript
import { importQL } from "https://deno.land/x/importql/mod.ts";
const query = importQL("query.graphql"); // import the .graphql file
// query is now a GraphQL syntax tree object.
// {
// "kind": "Document",
// "definitions": [
// {
// "kind": "OperationDefinition",
// "operation": "query",
// "name": null,
// "variableDefinitions": null,
// "directives": [],
// "selectionSet": {
// "kind": "SelectionSet",
// "selections": [
// {
// "kind": "Field",
// "alias": null,
// "name": {
// "kind": "Name",
// "value": "user",
// ...
```
## permissions
- --allow-read