graphql / vscode-graphql

MIGRATED: VSCode GraphQL extension (autocompletion, go-to definition, syntax highlighting)
https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphql
MIT License
557 stars 71 forks source link

Error using Apollo Client rest directive #272

Closed HosseinAgha closed 2 years ago

HosseinAgha commented 3 years ago

Actual Behavior

I get the Unknown directive "@rest". GraphQL: Validation error but I don't get the same error when I run apollo-codegen.

Expected Behavior

The predefined apollo client directives should be added by default.

Specifications

Logs Of TS Server || GraphQL Language Service

I don't see any errors in the GraphQL Language Service output.

vladev commented 3 years ago

I'm also struggling with this and even doing something like this has no effect:

// graphql.config.ts
import type { IGraphQLProject } from 'graphql-config'

const apolloRestSchema = require.resolve('apollo-link-rest/schema.graphql')

const config: IGraphQLProject = {
  schema: ['http://localhost:4000/graphql', 'lib/rest.graphql'],
  documents: 'graphql/*.graphql',
  include: [apolloRestSchema],
acao commented 2 years ago

all directives you intend to complete for need to be included in schema. adding them to include probably won't help.

acao commented 2 years ago

this should help!

graphql/graphiql#2329