Giter VIP home page Giter VIP logo

Comments (7)

divyenduz avatar divyenduz commented on April 27, 2024

@jhalborg, your configuration has includes under includes

projects:
  app:
    schemaPath: ./schema.graphql
    includes: [
      "includes": ["**/*.{graphql,ts,tsx}"],
    ]
    extensions:
      endpoints:
        default: http://localhost:4000/graphql
        dev: http://localhost:4000/graphql

From your last comment on the other issue, can you please fix that and revert (see below)? Thanks.

projects:
  app:
    schemaPath: ./schema.graphql
    includes: ["**/*.graphql"]
    extensions:
      endpoints:
        default: http://localhost:4000/graphql
        dev: http://localhost:4000/graphql

from vscode-graphql.

divyenduz avatar divyenduz commented on April 27, 2024

Also, the includes should only concern with graphql files i.e. it should look like ["**/*.graphql"]

from vscode-graphql.

jhalborg avatar jhalborg commented on April 27, 2024

Sorry, there was a lot of copy+pasting and reverting going on in the experimentation.

I've just tried on the same project with

projects:
  app:
    schemaPath: ./schema.graphql
    includes: ["**/*.graphql"]
    extensions:
      endpoints:
        default: http://localhost:4000/graphql
        dev: http://localhost:4000/graphql

Out of desperation, I also tried removing the file type from .graphqlconfig, and tried it with both .json (with a JSON config), .yaml and .yml, but no luck. I still get

ZEBRA 1: undefined undefined
ZEBRA: GraphQLProjectConfig {
  config: 
   { schemaPath: './schema.graphql',
     includes: [ '**/*.graphql' ],
     extensions: { endpoints: [Object], codegen: [Object] } },
  configPath: '[PROJECT PATH]/.graphqlconfig.yaml',
  projectName: 'app' } [PROJECT PATH]/schema.graphql

VSCode: Version 1.24.1 (1.24.1)
Plugin versino: 0.0.9
Macbook Pro on High Sierra (10.13.5)
Node v10.2.1

from vscode-graphql.

divyenduz avatar divyenduz commented on April 27, 2024

@jhalborg : Can you please update to 0.0.10 and try again?

I validated in the project that you had emailed me. After updating the configuration to be same as the above comment, it works.

Thanks!

from vscode-graphql.

jhalborg avatar jhalborg commented on April 27, 2024

Hey @divyenduz -

Thanks for helping, however it still doesn't work for me. Same project, .graphqlconfig.yaml is:

projects:
  app:
    schemaPath: schema.graphql
    includes: ["**/*.graphql"]
    extensions:
      endpoints:
        default: http://localhost:4000/graphql
        dev: http://localhost:4000/graphql
      
      codegen:
        - generator: prisma-binding
          language: typescript
          target: ./schema.graphql
          output:
            binding: src/generated/prisma.ts

I've made a short video demonstrating the issue here: https://youtu.be/ZpeHPLwJ6oc

Anything else I should try?

from vscode-graphql.

ntziolis avatar ntziolis commented on April 27, 2024

@divyenduz If the includes only regard the graphql files how do you distinguish which schema is to be used for gql tags?

The includes seem to be the right place to crate that relation for the gql tags as well. Since there needs to be configuration made to know which schema to use I would vote for putting it there.

from vscode-graphql.

divyenduz avatar divyenduz commented on April 27, 2024

@ntziolis : As of now, the extension tried to guess the correct schema based on .graphqlconfig.yml file. There are a few ideas floating to make this deterministic. That should happen soon.

from vscode-graphql.

Related Issues (20)

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.