Skip to content

crewdevio/importql

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

IMPORTQL 🎑

easy way to import and parse graphql files in deno

importql

install

install using Trex package manager

$ trex install --map importql

or use url

import { importQL } from "https://deno.land/x/importql/mod.ts";

use

# 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!
}
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

About

easy way to import and parse graphql files 🎑

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published