Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schemaglue doesnt't conncect extended resolvers files #19

Open
GCassa opened this issue Jan 21, 2020 · 0 comments
Open

Schemaglue doesnt't conncect extended resolvers files #19

GCassa opened this issue Jan 21, 2020 · 0 comments

Comments

@GCassa
Copy link

GCassa commented Jan 21, 2020

I would like to estend my Graphql schema and resolver (actually mocks functions) using the same structure as it's shown in the "What it Does" section, and it's actually working for the schema (in the extended one I'm successfully using GraghQL Schema-2-Schema Transpiler). Of course I need new resolvers functions to fetch the new types (actually mock data), but is not working and all I got are the defoult mocks for the scalar types (like "Hello World" for strings). What is going wrong?
This is my index:

import { mocks } from './graphql/standard/myMocks';
const { ApolloServer } = require('apollo-server');
const glue = require('schemaglue');
const { schema, resolver } = glue('./graphql', { mode: 'ts' });
const { transpileSchema } = require('graphql-s2s').graphqls2s;
const typeDefs = [transpileSchema(schema)];
const server = new ApolloServer({
   typeDefs,
   mocks
 });

server.listen({port: 4069}).then(({ url }) => {
  console.log(`🚀 Server ready at ${url}`);
});
 

And this is the flolders structure:
graphqlStructure

Thank you for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant