GraphQL query utility for serverside apps

Overview


GotQL


Write GraphQL queries as objects instead of strings

JavaScript Style Guide

This is a better implementation of the GraphQL query API via NodeJS, created as a wrapper of Got. It works like a transpiler, with a built in HTTPRequest Client (Got), allowing you to write your GraphQL queries as Javascript Objects instead of strings.

Built because manipulating strings is a real pain.

Table of Contents

Install

$ npm install gotql

Or

$ yarn install gotql

Basic Usage

const gotQl = require('gotql')

const query = {
  operation: {
    name: 'users',
    fields: ['name', 'age', 'id']
  }
}

const options = {
  headers: {
    "Authorization": "Bearer "
  },
  debug: false,
  useHttp2: false
}

gotQL.query('mygraphqlendpoint.com.br/api', query, options)
  .then(response => console.log(response.data))
  .catch(console.error)

What is it?

GotQL is a better interface for GraphQL queries. It provides a way for developers to run queries using JSON instead of strings. Which is a way more usable data format than the string itself.

See more on: https://hasura.io/blog/fluent-graphql-clients-how-to-write-queries-like-a-boss/

Motivation

Manipulating strings is very smelly, even on dynamically typed languages. So, in order to avoid things such as this:

Which can be translated to something waay more readable in a JSON format like this:

const mutation = {
  operation: {
    name: 'addLog',
    args: {
      logType: literal`status_change`, // Enum Value
      fromState: variables.fromState,
      toState: variables.toState,
      idUser: variables.idUser,
      idCampaign: variables.idCampaign,
      owner: {
        ownerType: variables.ownerType,
        username: variables.username,
        picture: variables.picture,
        name: variables.name,
        id: variables.id
      }
    },
    fields: [ 'uuid' ]
  }
}

This is why GotQL was created.

API

gotQl.query(graphQLEndpoint, query, [options])
  • Description: Performs a graphQL query

GraphQLEndpoint

  • Type: string
  • Description: The GraphQL endpoint to query on

query

options

See option object for more information.


gotQl.mutation(graphQLEndpoint, query, [options])
  • Description: Performs a graphQL mutation

GraphQLEndpoint

  • Type: string
  • Description: The GraphQL endpoint to query on

query

options

See option object for more information.


gotQl.parser(query, type)
  • Description: Parses a JSON-Like query and returns the query's string

query

type

  • Type: string
  • Description: Must be either 'query' or 'mutation'

Option Object

Both gotql.query and gotql.mutation accept an optional user option object with the following API:

  • Type: object
  • Description: The option object with the following properties.
    • errorStatusCode: Default HTTP status code to be returned on error
      • Type: number
    • headers: Additional headers to be sent
      • Type: object, in the form of [headerName: string]: headerValue: string
    • gotInstance: Customized Got instance to be used when calling the endpoint
      • Type: got. Internally this will be called as got.post(prependHttp(endPoint), gotPayload)
    • useHttp2: Boolean defining if the call should be made using HTTP2, defaults to false (see release 11 of got)
      • Type: boolean

Note: GotQL uses debug internally as default debugger, so you can set debug levels by setting the DEBUG environment variable. These are the current levels:

  • gotql:info
  • gotql:info:parser
  • gotql:info:runner
  • gotql:errors

Returns

All methods return a string like this:

const response = 'query { test { name args } }'

The JSON query format

The JSON format gotQL uses is a simple and intuitive description based on the anatomy of a GraphQL query blog post.

This is a generic model of a JSONLike query:

const query = {
  name?: string,
  operation: {
    name: string,
    alias?: string,
    args?: { [argName: string]: any } | {
      [argName: string]: {
        value: string,
        escape: boolean
      }
    },
    fields: (string | {
      [fieldName: string]: [{
        args?: { [argName: string]: any } | {
          [argName: string]: {
            value: string,
            escape: boolean
          }
        },
        fields?: (string | { [fieldName: string]: [any] })[]
      }]
    })[]
  },
  variables?: {
    [varName: string]: {
      type: string,
      value: string
    }
  }
}

Description

  • Query:
    • Type: object
    • Description: The full query object
    • Properties:
      • name: [optional]: Query name
        • Type: string
      • variables: [optional] Query variable declaration
        • Type: object with signature like [varName: string]: { type: string, value: string }
        • Properties:
          • varName: Variable name
            • Type: string
          • type: Variable type. Can be a GraphQL definition of type (i.e: string!)
            • Type: string
          • value: Variable value
            • Type: any
      • operation: The query operation (action that will be executed)
        • Type: object
        • Properties:
          • name: The operation name
            • Type: string
          • alias: [optional] An alias to give the operation
            • Type: string
          • args: [optional] The operation args
            • Type: [argName: string]: any or a detailed arg object
              • Simple args: An object where the key is the argument name and its value. Accepts variables in the format of argName: '$value'
                • Example: args { name: 'myName' }
              • Detailed args: A tagged template. This will give more control over escaping (mostly to use enums). Argument name should be the key
                • Type: tagged template
                • Examples: args: { status: literal`an_enum` } should output operation (status: an_enum)...
          • fields: The field list to get back from the operation
            • Type: An array of object (to use nested fields) or string, or both.
            • Properties (for nested fields):
              • Type: object where the field name is the key
              • fields: Recursive definition, accepts another array just like the fields above.
              • args: [optional] The field args
                • Type: [argName: string]: any or a detailed arg object
                  • Simple args: An object where the key is the argument name and its value. Accepts variables in the format of argName: '$value'
                    • Example: args { name: 'myName' }
                  • Detailed args: A tagged template. This will give more control over escaping (mostly to use enums). Argument name should be the key
                    • Type: tagged template
                    • Examples: args: { status: literal`an_enum` } should output operation (status: an_enum)...

Examples

Simple query

const query = {
  operation: {
    name: 'users',
    fields: ['name', 'age']
  }
}

Outputs:

query { users { name age } }

Named query

const query = {
  name: 'myQuery',
  operation: {
    name: 'users',
    fields: ['name', 'age']
  }
}

Outputs:

query myQuery { users { name age } }

Query with simple args

const query = {
  operation: {
    name: 'user',
    args: {
      name: 'Joe'
    },
    fields: ['name', 'age']
  }
}

Outputs:

query { user(name: "Joe") { name age } }

Query with variables

const query = {
  variables: {
    name: {
      type: 'string!',
      value: 'Joe'
    }
  },
  operation: {
    name: 'user',
    args: {
      name: '$name'
    },
    fields: ['name', 'age']
  }
}

Outputs:

query ($name: string!) { users(name: $name) { name age } }

Variables are sent on a separate object to graphQL.

{
  "variables": { "name": "Joe" }
}

Nested fields

const query = {
  operation: {
    name: 'users',
    fields: [
      'name',
      'age',
      {
        friends: {
          fields: ['name', 'age']
        }
      }
    ]
  }
}

Outputs:

query { users { name age friends { name age } } }

Recursive fields can go forever.

Enum and literal args

Enum or literal values should not be escaped, to do that, GotQL has a helper called literal which can be used to tell the query that value will not be escaped:

const { literal } = require('gotql')

const query = {
  operation: {
    name: 'user',
    args: {
      type: literal`internal`
    },
    fields: ['name', 'age']
  }
}

The code above outputs:

query { users(type: internal) { name age } }

The literal helper is just a shorthand to the old-style {value: string, escape: boolean} object like below:

const query = {
  operation: {
    name: 'user',
    args: {
      type: {
        value: 'internal',
        escape: false
      }
    },
    fields: ['name', 'age']
  }
}

If literal is omitted, or if escape is set to true, the output would be:

query { users(type: "internal") { name age } }

Note: Variables such as described here will not be recognized. If the arg object is not an [argName]: value, variables will not pass through the definition check (GotQL warns if a variable is not declared but used on operation).

Contributing to this project

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Hey! If you want to contribute, please read the contributing guidelines 😄

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Comments
  • Chokes on Complex Nested Fields with Arguments

    Chokes on Complex Nested Fields with Arguments

    query ($customerCode: String!, $dataRepositoryCode: String!, $dataCollectionCode: String!, $dataRecordIDs: [String!]!, $limit: Int) {
      customer(customerCode: $customerCode) {
        customerCode
        dataRepository(dataRepositoryCode: $dataRepositoryCode) {
          customerCode
          dataRepositoryCode
          metadata
          dataCollection(dataCollectionCode: $dataCollectionCode) {
            dataRecords(dataRecordIDs: $dataRecordIDs, limit: $limit) {
              entities {
                values
                relatedDataRecords
              }
            }
          }
        }
      }
    }
    
    enhancement 
    opened by ferronrsmith 12
  • Enum support

    Enum support

    Describe the bug Hasura's on_conflict argument expect enums to be provided without quotes, however gotql does use quotes for every argument value. This result in an error (see screenshots).

    To Reproduce

    gotQl.mutation(
      process.env.GRAPHQL_HOST,
      {
        operation: {
          name: 'insert_example',
          args: {
            objects: {id, status, price},
            on_conflict: {constraint: 'example_pkey', update_columns: ['status', 'price']},
          },
          fields: ['affected_rows'],
        }
      },
    )
    

    Current behavior Part of the query:

    on_conflict: {constraint: \"example_pkey\", update_columns: [\"status\", \"price\"]}
    

    Expected behavior Part of the query:

    on_conflict: {constraint: example_pkey, update_columns: [status, price]}
    

    Screenshots image image image

    wontfix 
    opened by franciscolourenco 11
  • [BUG] Adding custom gotInstance results in error

    [BUG] Adding custom gotInstance results in error

    Great package! Really hoping to use on my latest project, but I'm running into an error trying to use a custom got instance:

    Describe the bug Adding a custom gotInstance to the options results in the following error:

    Error when executing query: The `body`, `json` and `form` options are mutually exclusive
    

    To Reproduce Code sandbox reproducing issue: https://codesandbox.io/s/fervent-lake-lfeoe?file=/src/index.js Relevant code:

      const gotInstance = got.extend({
        timeout: 1000
      });
    
      const query = {
        variables: {
          code: {
            type: "ID!",
            value: code
          }
        },
        operation: {
          name: "country",
          args: {
            code: "$code"
          },
          fields: ["name", "capital"]
        }
      };
    
      const options = {
        gotInstance
      };
    
      const response = await gotQL.query(
          "https://countries.trevorblades.com",
          query,
          options
        );
    

    Current behavior Adding a got instance results in error

    Expected behavior Got instance should be used without error

    Additional context Code sandbox reproducing issue: https://codesandbox.io/s/fervent-lake-lfeoe?file=/src/index.js

    bug 
    opened by pilar1347 10
  • [BUG] Empty TypeScript declaration file

    [BUG] Empty TypeScript declaration file

    Describe the bug

    The package that is deployed to npm does not include anything in index.d.ts. It looks like this:

    export {};
    //# sourceMappingURL=index.d.ts.map
    

    To Reproduce Steps to reproduce the behavior:

    1. npm install gotql
    2. Open node_modules/gotql/dist/index.d.ts

    Current behavior

    This package can't be used in a TypeScript project.

    Expected behavior

    Types should be deployed within that package.

    bug 
    opened by screendriver 8
  • Seems to choke on boolean argument values

    Seems to choke on boolean argument values

    Describe the bug While parsing a query with a boolean argument it fails and I see:

    Error: Parse error: Failed to parse operation "WHATEVER" => varName.indexOf is not a function
    

    To Reproduce Steps to reproduce the behavior:

    1. Create a query with a boolean argument
    2. Try to parse it
    3. Feel sad

    Expected behavior I expected to see my query succeed.

    Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: macOS
    • Browser: Firefox
    • Version: Latest

    Additional context This is a great module, thanks for creating it.

    opened by NetOpWibby 6
  • Arg parsing error (Cannot read property 'indexOf' of undefined)

    Arg parsing error (Cannot read property 'indexOf' of undefined)

    Describe the bug Null arg values are not supported (Cannot read property 'indexOf' of undefined)

    To Reproduce

      return gotQl.mutation('https://example.com', {
        operation: {
          name: 'update_users',
          args: {
            where: {id: {_eq: userId}},
            _set: {name: null},
          },
          fields: ['affected_rows'],
        },
      })
    

    Current behavior

    Runner error: Error when executing query: Parse error: Failed to parse operation "update_users" => Cannot read property 'indexOf' of undefined
    

    Expected behavior null values should be supported.

    bug 
    opened by franciscolourenco 5
  • ✅ Update all tests to Jest

    ✅ Update all tests to Jest

    Description of the Change

    Ends work of @ohager on #43

    This changes contains jest-ts, and parse.test.js and runner.test.js are totally converted to ts. This branch resolves #41

    opened by wm4tos 4
  • Feat/jest

    Feat/jest

    Requirements

    • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
    • All new code requires tests to ensure against regressions

    Description of the Change

    Helping you out with Jest set up for TS and already converted parser tests to jest as you mentioned in #41

    Please merge #42 before

    This PR solves issue #41 only partially, but I think it's a good starting point ;)

    Feel free to neglect it

    Note: that I want to merge into your dev branch, as it is an incomplete feature (missing runner.test.js)

    opened by ohager 4
  • [FEATURE] Allow empty fields for mutations

    [FEATURE] Allow empty fields for mutations

    Is your feature request related to a problem? Please describe. I have mutations which do not return anything (although I know it's against best practices) and I couldn't use gotql for these mutations as the resulting query string is syntactically wrong and causing Bad Request

    gotql:info:parser Parsed query: mutation ($input: TransferInput!) { airdropPoints(args: $input) {  } } +0ms
    (node:20166) UnhandledPromiseRejectionWarning: Error: Runner error: Error when executing query: Response code 400 (Bad Request)
    

    Describe the solution you'd like Empty or nulled fields should not generate something like this:

    mutation ($input: TransferInput!) { airdropPoints(args: $input) {  }  }
    

    image (mind the red marker on the left side, indicating a syntax error)

    but this:

    mutation ($input: TransferInput!) { airdropPoints(args: $input)  }
    

    image (no syntax error)

    Describe alternatives you've considered As an alternative I need to make my mutations return something (which I actually consider and will do)

    Additional context I'm putting this as a feature request, as it is kind of my fault, that I'm not following best practices. Nevertheless, I think it's worth mentioning this situation which causes a syntax error on the query.

    Thanks, for this pretty handy library! :pray:

    enhancement 
    opened by ohager 4
  • [BUG] Issue with args containing $ sign

    [BUG] Issue with args containing $ sign

    Describe the bug Parser fails when args value contains $ sign

    To Reproduce

    const query = {
      operation: {
        name: 'user',
        args: {
          name: '$Joe'
        },
        fields: ['name', 'age']
      }
    }
    
    gotQL.parser(query, "query")
    

    Resulting in Error: Parse error: Failed to parse operation "user" => Variable "Joe" is defined on operation but it has neither a type or a value

    bug 
    opened by patrykwegrzyn 4
  • [BUG] Parse error: Failed to parse operation

    [BUG] Parse error: Failed to parse operation

    Describe the bug

    I try to create a mutation that looks like this:

    const mutation = {
      operation: {
        name: 'updateSomething',
        args: {
          id: '1234',
          data: {
            name: 'foo',
            status: 'bar',
          },
        },
        fields: ['test'],
      },
    };
    

    and I'm calling it like this

    const result = await gotQl.mutation(endpoint, mutation, {
      headers: {
        Authorization: `Bearer ${secret}`,
      },
    });
    

    But I get following runtime error:

    Error: Runner error: Error when executing query: Parse error: Failed to parse operation "updateSomething" => varName.indexOf is not a function
        at Object.<anonymous> (/Users/myproject/node_modules/gotql/dist/modules/runner.js:122:19)
        at Generator.next (<anonymous>)
        at /Users/myproject/node_modules/gotql/dist/modules/runner.js:8:71
        at new Promise (<anonymous>)
        at __awaiter (/Users/myproject/node_modules/gotql/dist/modules/runner.js:4:12)
        at Object.run (/Users/myproject/node_modules/gotql/dist/modules/runner.js:103:12)
        at Object.mutation (/Users/myproject/node_modules/gotql/dist/mutation.js:23:21)
        at update (/Users/myproject/myscript.js:35:32)
        at Object.<anonymous> (/Users/myproject/myscript.js:43:1)
        at Module._compile (internal/modules/cjs/loader.js:776:30)
    
    bug hacktoberfest 
    opened by screendriver 4
  • Bump ansi-regex from 4.1.0 to 4.1.1

    Bump ansi-regex from 4.1.0 to 4.1.1

    Bumps ansi-regex from 4.1.0 to 4.1.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump minimist from 1.2.5 to 1.2.6

    Bump minimist from 1.2.5 to 1.2.6

    Bumps minimist from 1.2.5 to 1.2.6.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump tmpl from 1.0.4 to 1.0.5

    Bump tmpl from 1.0.4 to 1.0.5

    Bumps tmpl from 1.0.4 to 1.0.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • [BUG] Parse error: Failed to parste array inside of args

    [BUG] Parse error: Failed to parste array inside of args

    Describe the bug I am trying to build a mutation that looks something like this:

    const mutatuion = {
          operation: {
            name: 'createCart',
            args: {
              draft: {
                currency,
                store: {
                  typeId: 'store',
                  key: tenant,
                },
                itemShippingAddresses: [],
                discountCodes: [],
                lineItems: [],
                customLineItems: [],
                customerId: userId,
                shippingAddress: {
                  country: tenant,
                },
                shippingMethod: {
                  key: 'defaultShipping',
                  typeId: 'shipping-method',
                },
                externalTaxRateForShippingMethod: {
                  name: 'noTaxes',
                  amount: '$amount',
                  includedInPrice: false,
                  country: tenant,
                },
                taxMode: `$taxMode`,
                custom: {
                  typeKey: 'cart',
                  fields: [
                    {
                      name: 'pceId',
                      value: pceId,
                    },
                  ],
                },
              },
            },
            fields: this.cartFields,
          },
          variables: {
            amount: {
              type: 'Float!',
              value: '0',
            },
            taxMode: {
              type: 'TaxMode',
              value: 'External',
            },
          },
        }
    

    Current behavior As soon as the gotql.parser processes this QueryType, the array is truncated by the property custom.fields. This means that the property "value" disappears in the listed object. The Result is something like that:

    mutation ( $amount: Float!, $taxMode: TaxMode ) { createCart(draft: { currency: "EUR", store: { typeId: "store", key: "DE" },itemShippingAddresses: [],discountCodes: [],lineItems: [],customLineItems: [],customerId: "uuidv4",shippingAddress: { country: "DE" },shippingMethod: { key: "defaultShipping", typeId: "shipping-method" },externalTaxRateForShippingMethod: { name: "noTaxes", amount: $amount,includedInPrice: false,country: "DE" },taxMode: $taxMode,custom: { typeKey: "cart", fields: [{ name: "pceId" }] } })
    

    Expected behavior I simply expect the property value with its corresponding value to still be listed in the object. As an example, this value is now represented by the variable pceId

    mutation ( $amount: Float!, $taxMode: TaxMode ) { createCart(draft: { currency: "EUR", store: { typeId: "store", key: "DE" },itemShippingAddresses: [],discountCodes: [],lineItems: [],customLineItems: [],customerId: "uuidv4",shippingAddress: { country: "DE" },shippingMethod: { key: "defaultShipping", typeId: "shipping-method" },externalTaxRateForShippingMethod: { name: "noTaxes", amount: $amount,includedInPrice: false,country: "DE" },taxMode: $taxMode,custom: { typeKey: "cart", fields: [{ name: "pceId", value: pceId }] } })
    

    At this stage, I suspect that this bug is caused by the checkArgs function during the isArray condition within your parser. Thanks, for this pretty library! 🙏

    bug help wanted hacktoberfest 
    opened by Luanee 2
  • [FEATURE] Add inline fragments support

    [FEATURE] Add inline fragments support

    I have seen that there is a closed issue regarding adding graphql fragments support for v1.7.0 but I haven't found it in release notes or source code. Could you implement such a feature for gotql or give an example of how to use it if I am wrong and gotql v2.* supports fragments? We are using gotql for more than 6 months and it's already deeply implemented in our code to change it to something else.

    enhancement help wanted hacktoberfest needs refactor 
    opened by andriy-sermiahin 10
Releases(v2.1.0-alpha1)
Owner
Lucas Santos
Full Stack Developer, technology lover. Speaker, teacher, former Microsoft MVP, active Google Developer Expert, Docker Captain, and black screen hipster.
Lucas Santos
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
just a graphql example created by typescript + fastify + mikro-orm(postgresql) + mercurius(graphql adaptor) + type-graphql

fastify-mikro-orm-mercurius-graphql-example A MikroORM boilerplate for GraphQL made with Fastify, Mercurius, Typescript using TypeGraphQL ?? Packages

Vigen 10 Aug 28, 2022
A simple query builder, it will helps to develop DSL query for Elasticsearch

Elasticsearch Dynamic Query Builder A simple query builder, it will helps to develop DSL query for elasticsearch Installation You can start it from np

Hashemi Rafsan 4 Nov 20, 2022
A library for creating typesafe standardized query keys, useful for cache management in @tanstack/query

Query Key Factory Typesafe query key management for @tanstack/query with auto-completion features. Focus on writing and invalidating queries without t

Luke Morales 446 Jan 3, 2023
curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.

graphqurl graphqurl is a curl like CLI for GraphQL. It's features include: CLI for making GraphQL queries. It also provisions queries with autocomplet

Hasura 3.2k Jan 3, 2023
NextJS with GraphQL using type-graphl and graphql-codegen adoptable dogs example code

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Jack Herrington 2 Mar 31, 2022
GraphQL Fastify Server is an implementation of GraphQL.

GraphQL Fastify Server Installation Usage Using cache Middlewares Liveness & Readiness Contributing License Installation npm install --save graphql-fa

Rui Silva 33 Dec 19, 2022
GraphQL-first boilerplate that scales with TypeScript + Node Express + Apollo GraphQL APIs.

graphql-typescript-boilerplate A boilerplate project for quickly building Graphql APIs and with typescript ?? Installation Install the dependencies: y

Youssef Hajjari 6 May 15, 2022
next-graphql-server is a library for building production-grade GraphQL servers using Next.js with API Routes

next-graphql-server next-graphql-server is an easy to use Next.js library for creating performant GraphQL endpoints on top of Next.js API Routes. Star

Jakub Neander 82 Nov 21, 2022
GraphQL Hive provides all the tools the get visibility of your GraphQL architecture at all stages, from standalone APIs to composed schemas (Federation, Stitching)

GraphQL Hive GraphQL Hive provides all the tools the get visibility of your GraphQL architecture at all stages, from standalone APIs to composed schem

Kamil Kisiela 184 Dec 21, 2022
A utility for creating toggleable items with JavaScript. Inspired by bootstrap's toggle utility. Implemented in vanillaJS in a functional style.

LUX TOGGLE Demo: https://jesschampion.github.io/lux-toggle/ A utility for creating toggleable dom elements with JavaScript. Inspired by bootstrap's to

Jess Champion 2 Oct 3, 2020
A set of tools, helping you building efficient apps in a fast way. >> SvelteKit & GraphQL <<

KitQL KitQL, A set of tools, helping you building efficient apps in a fast way. ?? Infos Documentation: https://kitql.vercel.app/ Day by day progress,

JYC 262 Dec 27, 2022
An open-source, self-hosted, low-code framework to build internal tools, web apps, admin panels, BI dashboards, workflows, and CRUD apps with YAML or JSON.

An open-source, self-hosted, low-code framework to build internal tools, web apps, admin panels, BI dashboards, workflows, and CRUD apps with YAML or JSON.

Lowdefy 2k Jan 4, 2023
Vtexio-react-apps - Apps react para plafaforma VTEX.

Projeto Modal + Apps Extras Projeto modal setando cookies. Desenvolvido em React + TypeScript para aplicação em e-commerce VTEXIO. ?? Este projeto se

Marcelo 1 Jan 3, 2022
Open apps directly in GNOME Software by clicking Install from Flathub and apps.gnome.

Flatline Open apps directly in GNOME Software by clicking Install from Flathub and apps.gnome. Load the extension in Firefox Clone the repository Open

Cleo Menezes Jr. 43 Nov 7, 2022
Open apps directly in GNOME Software by clicking Install from Flathub and apps.gnome.

Flatline Open apps directly in GNOME Software by clicking Install from Flathub and apps.gnome. Instalation Enable Epiphany extension. Optional if not

GNOME Web Extensions 12 Sep 2, 2022
Sample apps showing how to build music and video apps for Xbox using a WebView.

description languages name page_type products urlFragment Sample showing how to build music and video apps using primarily web technologies for Xbox.

Microsoft 11 Dec 14, 2022
The Power CAT code components are a set of Power Apps component framework (PCF) controls that can be used to enhance power apps.

Power CAT code components The Power CAT code components are a set of Power Apps component framework (PCF) controls that can be used to enhance power a

Microsoft 70 Jan 2, 2023