All Projects β†’ Mayank1791989 β†’ Gql

Mayank1791989 / Gql

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Gql

Guide
πŸ“– The GraphQL Guide website
Stars: ✭ 104 (-4.59%)
Mutual labels:  graphql
Spectrum
Simple, powerful online communities.
Stars: ✭ 10,315 (+9363.3%)
Mutual labels:  graphql
Gatsbytutorials.com
A community-updated list of video, audio and written tutorials to help you learn GatsbyJS. πŸ‘©β€πŸ’»
Stars: ✭ 109 (+0%)
Mutual labels:  graphql
Serverless Postgraphql
Serverless GraphQL endpoint for PostgresSQL using AWS, serverless and PostGraphQL
Stars: ✭ 105 (-3.67%)
Mutual labels:  graphql
Firebase Functions Graphql Example
GraphQL server running on Cloud Functions for Firebase
Stars: ✭ 107 (-1.83%)
Mutual labels:  graphql
Prettier
Prettier is an opinionated code formatter.
Stars: ✭ 41,411 (+37891.74%)
Mutual labels:  graphql
Graphql Subscriptions
πŸ“° A small module that implements GraphQL subscriptions for Node.js
Stars: ✭ 1,390 (+1175.23%)
Mutual labels:  graphql
Graphql Pundit
Pundit authorization helpers for the GraphQL Ruby gem
Stars: ✭ 109 (+0%)
Mutual labels:  graphql
Meteor Integration
πŸš€ meteor add apollo
Stars: ✭ 107 (-1.83%)
Mutual labels:  graphql
Angular1 Apollo
AngularJS integration for the Apollo Client
Stars: ✭ 108 (-0.92%)
Mutual labels:  graphql
Shapeshifter
🐺 Generate relational schemas, PropTypes, Flow aliases, and TypeScript interfaces from JSON or GraphQL schematic files.
Stars: ✭ 105 (-3.67%)
Mutual labels:  graphql
Porn Vault
πŸ’‹ Manage your ever-growing porn collection. Using Vue & GraphQL
Stars: ✭ 1,634 (+1399.08%)
Mutual labels:  graphql
Graphql Google Pubsub
A graphql-subscriptions PubSub Engine using Google PubSub
Stars: ✭ 108 (-0.92%)
Mutual labels:  graphql
Relay Northwind App
A complex React, Relay, GraphQL demo app. Online demo:
Stars: ✭ 104 (-4.59%)
Mutual labels:  graphql
Src Cli
Sourcegraph CLI
Stars: ✭ 108 (-0.92%)
Mutual labels:  graphql
The Road To Graphql Chinese
πŸ““The Road to GraphQL: Your journey to master pragmatic GraphQL in JavaScript
Stars: ✭ 104 (-4.59%)
Mutual labels:  graphql
Strapi
πŸš€ Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+38235.78%)
Mutual labels:  graphql
Gest
πŸ‘¨β€πŸ’» A sensible GraphQL testing tool - test your GraphQL schema locally and in the cloud
Stars: ✭ 109 (+0%)
Mutual labels:  graphql
Flask Graphene Sqlalchemy
βš—οΈProject template to build a GraphQL API in Python
Stars: ✭ 109 (+0%)
Mutual labels:  graphql
Snug
Write reusable web API interactions
Stars: ✭ 108 (-0.92%)
Mutual labels:  graphql

Travis Codecov npm

gql

Graphql sevice which watches project files and provides:

Schema

  • [x] Validation
  • [x] Autocompletion
  • [x] Get Defintion
  • [x] Find References
  • [x] Get Info of symbol at position.
  • [x] Watch files and auto update

Query

  • [x] Validation
  • [x] Autocompletion
  • [x] Get Definition
  • [x] Support Embedded queries (Relay.QL, gql, others)
  • [x] Get Info of symbol
  • [ ] Find References
  • [ ] Provide query schema dependency graph.

Installation

  1. Install the node package: yarn add @playlyfe/gql --dev or npm install @playlyfe/gql --dev
  2. Make sure watchman is installed.
  3. Create the .gqlconfig file in project root.

.gqlconfig

The configuration file is specified in the json5 format.

To specify the configuration, you can refer to the configuration definition schema.

View configuration definition schema
type GQLConfig = {
  schema: {
    files: FileMatchConfig,
    validate?: ValidateConfig
  },
  query?: { // query optional
    files: Array<{
      match: FileMatchConfig, // match files
      parser: QueryParser,
      isRelay?: boolean,
      validate?: ValidateConfig,
    }>
  }
};

type FileMatchConfig = Globs | { include: Globs, ignore?: Globs };
type Globs = string | Array<string>; // eg **/*.js  **/*.gql

type QueryParser = (
  'QueryParser'
  | ['EmbeddedQueryParser', { startTag: regexpStr, endTag: regexpStr }];
);

type ValidateConfig = {
  extends: 'gql-rules-schema' | 'gql-rules-query' | 'gql-rules-query-relay',
  rules?: {
    [ruleName: string]: 'off' | 'warn' | 'error',
  },
};

Examples

Specifying only schema support (query parsing and related features are disabled):

// .gqlconfig (only schema)
{
  schema: {
    files: 'schema/**/*.gql'
  }
}

Specifying query and schema support:

// .gqlconfig (with query)
{
  schema: {
    files: 'schema/**/*.gql',
  },
  query: {
    files: [
      // query gql files
      {
        match: 'path/to/files/**/*.gql',
        parser: 'QueryParser',
      },
      // [Embedded queries] relay files
      {
        match: { include: 'path/to/code/**/*.js', ignore: '**/tests/**/*.js' },
        parser: [ 'EmbeddedQueryParser', { startTag: 'Relay\\.QL`', endTag: '`' } ],
        isRelay: true,
      },
      // [Embedded queries] gql tag files
      {
        match: { include: 'path/to/code/**/*.js', ignore: '**/tests/**/*.js' },
        parser: [ 'EmbeddedQueryParser', { startTag: 'gql`', endTag: '`' } ],
      },
      // [Embedded queries] some other tags
      {
        match: 'path/to/code/**/*.xyz',
        parser: [ 'EmbeddedQueryParser', { startTag: '"""' endTag: '"""' } ],
      },
      // [Embedded queries] some other tags and modify validation rules
      {
        match: 'path/to/code/**/*.xyz',
        parser: [ 'EmbeddedQueryParser', { startTag: '"""' endTag: '"""' } ],
        validate: {
          extends: 'gql-rules-query',
          rules: {
            LoneAnonymousOperation: 'off',
            NoUnusedVariables: 'warn',
          },
        }
      },
    ]
  }
}

Plugins

API

If you're looking to implement the GQL service in a plugin, you'll need to call these service APIs:

class GQLService {
  constructor(options: ?Options)

  /*** List of supported commands ***/

  // query errors
  status(): Array<GQLError>

  // autocomplete suggestion at position
  autocomplete(params: CommandParams): Array<GQLHint>

  // Gets the definition location
  getDef(params: CommandParams): ?DefLocation

  // Find all refs of symbol at position
  findRefs(params: CommandParams): Array<DefLocation>

  // gets the info of symbol at position
  getInfo(params: CommandParams): ?GQLInfo

  /*** Helpers ***/

  // return different file extensions found in .gqlconfig
  getFileExtensions(): Array<string>
}

type Options = {
  cwd?: string,
  onChange?: () => void, // called when something changes
  onInit?: () => void, // called once after initialization
  debug?: boolean, // enable debug logs
};

type CommandParams = {
  sourceText: string,
  sourcePath: string,
  position: {
    line: number, // starts with 1
    column: number, // starts with 1
  },
};

type DefLocation = {
  start: { line: number, column: number },
  end: { line: number, column: number },
  path: AbsoluteFilePath,
};

type GQLError = {
  message: string,
  severity: 'warn' | 'error',
  locations: ?Array<{ line: number, column: number, path: AbsolutePath }>,
};

type GQLHint = {
  text: string,
  type?: string,
  description?: string,
};

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].