Hi guys, I've set-up a GraphQL Server using Prisma...
# orm-help
g
Hi guys, I've set-up a GraphQL Server using Prisma, graphql-yoga and some other packages. Now I wish to start using the api in a client application. Is there any plugin/method to have autocompletion/validation in VSCode when writing queries / mutations within the gql`...` tags based on the graphql schema?
h
g
Thanks, I've looked into it, but how do you use the server graphql schema within the client app? (for autocompletion and validation)
So you add to include path to your files + schema to work with 🙂
So in front-end you add
**/*.ts
with your
*.ts
files
g
What I did up until now: - Added my schema.graphql file to the client app at this location
schema/schema.graphql
- Added a
.graphqlconfig.yml
file with the following contents:
Copy code
projects:
  app:
    schemaPath: schema/schema.graphql
    includes: ["schema/*.graphql"]
    extensions:
      endpoints:
        default: <http://localhost:4000>
- Installed the vscode plugin - Reloaded vscode - Created a .ts file where I started testing:
Copy code
import { gql } from 'graphql'

const QUERY = gql...
- I would expect the autocompletion to happen when I start writing a query within the gql`` tag, but it doesn't. Any idea what I'm missing here?
j
I followed all the steps above and am having the same problem, I'm not getting any auto-completion. Output > GraphQL Language Server isn't reporting any problems either.
n