Skip to content

Latest commit

 

History

History

graphql

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GraphQL

Keywords: REST Alternative

Links

Alternatives

Content

Tools

Terms

  • Schema Definition Language (SDL)

Approach

  • Code-Only or Code-first
  • Schema-first or SDL-first

Glossary

  • Schema Definition Language (SDL)

Specification

Core Concepts

  • Fields
  • Arguments
  • Alias
  • Fragments
  • Operation Name
  • Variables

Library

Installation

# Using NPM
npm install graphql

# Using Yarn
yarn add graphql

Extend With

Eslint

# Using Yarn
yarn add eslint-plugin-graphql --dev
/**
 * @type { import('@types/eslint').Linter.Config }
 */
const eslintRC = {
  // ...
  overrides: [
    {
      files: ['./src/graphql/queries/*.graphql'],
      parser: '@graphql-eslint/eslint-plugin',
      plugins: ['@graphql-eslint'],
      rules: {
        '@graphql-eslint/known-type-names': 'error',
      },
    },
  ],
}

module.exports = eslintRC

Tips

Visual Studio Code

#
code --install-extension 'GraphQL.vscode-graphql'

#
jq '."recommendations" += ["GraphQL.vscode-graphql"]' "$PWD"/.vscode/extensions.json | sponge "$PWD"/.vscode/extensions.json

Issues

TBD

Query root type must be provided.

TODO