Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 10 days 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 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-04T20:59:33.000Z (over 3 years ago)
- Last Synced: 2024-04-14T09:58:31.746Z (7 months ago)
- Topics: deno, denoland, graphql, parse-graphql-files, typescript
- Language: TypeScript
- Homepage:
- Size: 3.91 KB
- Stars: 12
- Watchers: 2
- 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/)
![importql](https://i.ibb.co/k5P665d/importql.png)
## 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 filetype 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