You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 8, 2021. It is now read-only.
How do I import a typescript file as the schema in graphqlgen configuration.
I am using graphql-code-generator to generate types from my schema using: schema: http://localhost:4000/graphql
Then, as I am trying to use graphqlgen to generate resolvers from these generated types and the schema.
I am getting this error:
G:\server\prod\apollo-server>graphqlgen
Error occurred while reading schema: Syntax Error: Cannot parse the unexpected character ".".
GraphQL request (1:1)
1: ./src/makeExecutableSchema.ts
^
G:\server\prod\apollo-server>
My graphqlgen.yml is:
# The target programming language for the generated code
language: typescript
# The file path pointing to your GraphQL schema
schema: ./src/makeExecutableSchema.ts
# Type definition for the resolver context object
context: ./src/context.ts:Context
# Map SDL types from the GraphQL schema to TS models
models:
files:
#- ./src/generated/prisma-client-ts/index.ts
- ./src/types.d.ts
# Generated typings for resolvers and default resolver implementations
# Please don't edit this file but just import from here
output: ./src/generated/graphqlgen.ts
# Temporary scaffolded resolvers to copy and paste in your application
resolver-scaffolding:
output: ./src/generated/tmp-resolvers/
layout: file-per-type