Giter VIP home page Giter VIP logo

vscode-graphql's Issues

Import of .env file not working

.graphqlconfig and .env are in the root of the project, but the Graphql Language Server failed silent. It works if the key is directly in the .graphqlconfig-file.

bildschirmfoto 2018-08-11 um 17 02 19

Code: 1.25.1
GraphQL: 0.0.10

How to install Watchman on windows!

I have installed the plugin, reload the application and then headed over to my schema.graphql

So this is what thus plugin should do!

  1. syntax highlighting (type, query, mutation, interface, union, enum, scalar, fragments)
  2. autocomplete suggestions
  3. validation against schema
  4. snippets (interface, type, input, enum, union)
  5. hover support
  6. go to definition support (input, enum, type)

It does none of those things for me
I'm also getting this error
watchman

Question how do I install Watchman on my windows machine, I looked at facebook guide and it's little bit advanced.

Jump-to-definition not working within schema definition file

I'm using Relay, so our project only has a single .graphql file, which is the schema itself. I'd expect to be able to cmd-click on things (or use jump to definition menu item) to jump around the file itself, but VSCode is telling me there's no definition found.

This is my .graphqlconfig file:

{
  "schemaPath": "data/schema.graphql",
  "includes": ["**/*.graphql"]
}

Log output from GraphQL Language Server:

ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'data/schema.graphql',
     includes: [ '**/*.graphql' ] },
  configPath: '/Users/andrewingram/Repositories/tego-app/.graphqlconfig',
  projectName: undefined } /Users/andrewingram/Repositories/tego-app/data/schema.graphql

Getting errors on local schema file with custom built directives

I have a custom directive declared in my local schema file, and it is throwing validation errors when used in this file.

[GraphQL: Validation] Unknown directive "withAuth"

screen shot 2018-06-19 at 11 46 36 am

Maybe it's a bug?

Maybe we can have an option in the settings for the extension to declare our own directives or maybe to ignore such errors.

graphql as tagged template

Is there a way to use graphql template tag instead of gql?

I am trying out gatsby.js which uses relay for it queries.

Edit:
I tried import { graphql as gql } from 'graphql-relay'; but it doesn't seem to validate against a pre generated schema.

screen shot 2018-07-09 at 07 18 19

Similar query using intellij-graphql:

screen shot 2018-07-09 at 07 19 45

Checklist for the first version

Intro

With this issue I hope to lock down the checklist for the first version and create a place to maintain the context of things/features happening in VSCode/GraphQL Language Service ecosystem that are of concern to us for the features we want to implement.

Note: .graphqlconfig file and its YAML/YML counterparts are referred in this document as graphql-config file

Checklist

General features

  • Load the extension on detecting graphql-config file at root level or in a parent level directory
  • Load the extension in .graphql, .gql files
  • Load the extension on detecting gql tag in js, ts, jsx, tsx, vue files
  • Load the extension on detecting graphql-config file in a sub-directory
  • Support graphql-config file with one project and multiple projects
  • Workspaces and multiple root level folder support in VSCode
  • Test coverage
  • Dev setup and usage readme

.graphql, .gql file extension support

  • syntax highlighting (type, query, mutation, interface, union, enum, scalar, fragments)
  • autocomplete suggestions
  • validation against schema
  • snippets (interface, type, input, enum, union)
  • hover support
  • go to definition support

gql tagged template literal support

  • syntax highlighting (type, query, mutation, interface, union, enum, scalar, )
  • autocomplete suggestions
  • validation against schema
  • snippets
  • hover support
  • go to definition

Autocomplete not working

We have a scenario where we're breaking up the type definitions / resolvers into individual projects. The server handles merging the type definitions and resolvers before starting. I'm having a hard time configuring this plugin for the individual projects. In all of the examples I see schema is included, but we don't have access to the generated schema as it's created dynamically.

Here's all that's in my .graphqlconfig:

{
    "includes": ["./lib/types/**/*.{gql,graphql}"],
}

Syntax highlighting, peek definition, and go to definition all work. Auto-complete does not.

Support for .graphqlconfig in a subdirectory

Hey this extension is awesome!! 😄

I would love to see some support for loading .graphqlconfig files from either subdirectories, or the setting/ability to load from a specified file/folder.

My set up looks like the following:

project_root/
    client/
        ...
    server/
        .graphqlconfig.yml
        ...

It seems like I'm not the only one experiencing this.

I'm currently receiving this error:
screen shot 2018-06-18 at 5 58 46 pm

Not getting autocomplete in `gql` literals

Running 0.0.8 from the marketplace, VS Code 1.24.1. TypeScript is 2.9.1, set to "Use VS Code’s version"

In a fetch-commissions.ts file, I have:

const QUERY = gql`
  query FetchCommissions {
    commissions {
      id
      name

    }
  }
`;

With the insertion point on the line after name I press Control-space but the autocomplete suggestions are generic, without any from my schema for the Commission type.

In a sibling test.graphql file I have the exact same query and autocomplete works as expected there (little wrench icons next to the fields from my GraphQL types).

Not sure it matters, but I’m not using the graphql-tag package for my gql definition. I have my own gql that just makes a string literal (I don’t want the AST).

My .graphqlconfig file is:

{
  "projects": {
    "commissions-app": {
      "schemaPath": "./services-js/commissions-app/graphql/schema.graphql",
      "includes": [
        "./services-js/commissions-app/src/client/**/*.{graphql,ts,tsx,js,jsx}"
      ]
    }
  }
}

My fetch-commissions.ts file is at ./services-js/commissions-app/src/client/graphql/fetch-commissions.ts so it should be covered under "includes".

Also: I do see GraphQL syntax highlighting in the gql tag that is coming from this extension, so it’s at least somewhat loading for this file.

Hover not working

Currently when hovering over a variable the highlighting changes but there is no intellisense provided.

inside GatsbyJS

Hi!
I'm trying to get this VSCode extension working for a Gatsby site.
I have the results of the introspectionquery stored in schema.json in the root of the project.
Also in the root of the project is a .graphqlconfig.yml that only contains schemaPath: schema.json

Gatsby uses tagged strings for graphQL, but the tag is graphql, not gql like in Apollo.
Syntax highlighting does work.

How should I further configure things to also get the autocomplete suggestions/query validation from this plugin?

To reproduce:

Thanks!

edit: Oops, part duplicate of #49.

"undefined undefined" when opening .graphql file containing queries

opening graphql-server-example/queries/booking.graphql from https://github.com/graphcool/graphql-server-example produces a lot of error output:

ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'src/generated/prisma.graphql',
     includes: [ 'prisma.graphql', 'seed.graphql', 'datamodel.graphql' ],
     extensions: 
      { prisma: 'prisma/prisma.yml',
        codegen: [Object],
        endpoints: [Object],
        customDirectives: [Object] } },
  configPath: '/Users/marktani/projects/playground/prisma/triaging/graphql-server-example/.graphqlconfig.yml',
  projectName: 'prisma' } /Users/marktani/projects/playground/prisma/triaging/graphql-server-example/src/generated/prisma.graphql
Definition not found for GraphQL type DateTimeDefinition not found for GraphQL type StringDefinition not found for GraphQL type StringDefinition not found for GraphQL type StringDefinition not found for GraphQL type StringDefinition not found for GraphQL type BooleanDefinition not found for GraphQL type StringDefinition not found for GraphQL type StringDefinition not found for GraphQL type BooleanZEBRA 1: undefined undefined
(node:46935) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'schemaPath' of undefined
(node:46935) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[Error - 11:48:31 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 
[Error - 11:48:32 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 
[Error - 11:48:33 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 
[Error - 11:49:55 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 
[Error - 11:49:57 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 
[Error - 11:49:57 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 
[Error - 11:50:01 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 

Language Packs category is for display language extensions

The "Language Packs" VS Code extension category is to designate disaplay language (German, Bulgarian) extensions and not for general programming language extensions.

Please remove "Language Packs" from the categories in package.json:

"categories": [
    "Programming Languages",
    "Snippets",
    "Linters",
    "Themes",
    "Other",
    "Language Packs" <--

Validation and auto-completion for hand-typed `info` objects in resolvers

As discussed in this forum post

I'm wondering if there is any way to validate handwritten queries passed instead of info in Prisma resolvers against the Prisma DB schema? In the following example, I have a User model that has a reference to a UserCredentials model. In the login resolver, I will find the UserCredential by the passed email, and find the relevant User's ID from a handwritten query:

resolve: async (parent, { email, password }, ctx, info) => {
    const userCredentials = await ctx.db.query.userCredential({ where: { email } }, `{id password user {id}}`);
    ...
}

I would like to check queries like that against the schema - how would I do that? 😃

And even better - how could you get auto completion in VSCode for these strings?

PS: The idea came from the HowToGraphQL tutorial project (https://github.com/howtographql/graphql-js/blob/master/src/resolvers/Mutation.js#L34)

File Resolution inconsistent

While using Intellisense in an .graphql file, the vscode debug tab for GraphQL Language Server sometimes throws the following error:

ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: 'packages/api-graphql/src/schema.graphql',
     includes: [ '**/*.graphql' ],
     extensions: { endpoints: [Object] } },
  configPath: 'e:\\dev\\gql-demo\\.graphqlconfig.yml',
  projectName: 'app' } e:\dev\gql-demo\packages\api-graphql\src\schema.graphql
(node:14416) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 45): Error: ENOENT: no such file or directory, open 'e:\e%3A\dev\gql-demo\packages\react-apollo\src\queries\posts.graphql'

i could imagine that it is a Windows-only problem 😉

[Icon Request] Support for graphql files

Current state
screen shot 2018-07-27 at 11 47 00 am

Description:

Add missed ".graphql" and ".gql" extensions for files to support graphql icon. many people reported this issue on vscode-icons and they referred developers to submit the request directly to the extensions.

Checklist:

I'm sure this issue is not a duplicate?
Thanks.

Add status indicator to status bar

It would be very useful to have some type of indicator (spinner, whatever) in the status bar that updates whenever the graphql lang server is working.

While the implementation is not identical, here is an example from flow-vs-code ext that provides this feature.

Example showing another ext with this feature:

flow-vscode

Support graphql imports.

When you are using the graphql-tag/loader plugin for webpack you can use graphql imports to pull fragments from other files.

#import "./MyFragment.graphql"

query test {
  item {
     ...MyFragment
  }
}

Hovering over the fragment logs the following to the GraphQL Language Server log:
"Definition not found for GraphQL fragment MyFragment"

Config setup to a .js-based schema?

Hello!

GraphQL newbie here, trying to gain autocomplete and other goodies with this extension. The issue I'm having is that my schema is a JavaScript file, thus a .js extension. And I'm not sure if your system supports that kind of schema, since there are no examples which show that kind of schema file being used.

I have tried setting up a .graphqlconfig.yml file to enable auto-complete in my client-side gql queries, but it is not working - presumably because this plugin does not support connection to .js-based schemas?

Here's what I tried for setting up my .graphqlconfig.yml file

At first I tried using the GraphQL CLI. But that failed since it would not let me specify my schema file which has a .js extension:

image

Next I tried just manually creating the .graphqlconfig.yml file:

image

Results after my config setup

In my client-side gql queries, I tried pressing control + spacebar to get auto-complete possibilities which would relate to my schema, but it did not work:

image

Summary

How can I use my .js-based schema file with this extension?

Go To Definition No Longer works

I am not sure if this is misconfiguration on my side, but Go To Definition No longer works for me. I tried on several projects on different computers and it is the case.

One repro is here:

https://github.com/tomitrescak/corporator

Do you have some test project where it works?
Thanks

[EDIT] I have just downloaded your project "graphql-server-example", No luck there. Is it maybe error in the latest visual studio code? I did not try to downgrade yet.

Obtuse error when starting

I just tried to set up the plugin for a project I'm working on where we have a monorepo — frontend & backend code in one repo. I've added a .graphqlconfig to the root of the project with:

{
  "schemaPath": "backend/src/sys/graphql/schema.graphql",
  "includes": ["*.graphql"],
  "extensions": {
    "endpoints": {
      "dev": {
        "url": "http://localhost:22015/graphql",
        "headers": {
          // secret-removed
        }
      }
    }
  }
}

The error I receive is:

Request initialize failed with message: Parsing <project path>/.graphqlconfig file has failed. Unexpected token } in JSON at position 277

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.