nicolasdao / schemaglue

Naturally breaks down your monolithic graphql schema into bits and pieces and then glue them back together.
BSD 3-Clause "New" or "Revised" License
116 stars 13 forks source link

Schemaglue doesnt't conncect extended resolvers files #19

Open GCassa opened 4 years ago

GCassa commented 4 years ago

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