Closed jeevanpillay0000 closed 5 years ago
You can update the version of easygraphql-tester
for the latest one, and then remove extend
from the schemas. It's using merge-graphql-schemas
under the hood and it works without the extend
.
Let me know if it works for you!
@lpfloyd I'm going to close this issue, if it's needed we can open again.
Hi,
So I just started using easygraphql-tester, however, I ran into a problem.
My applications is structure by using stitching to achieve modularisation.
Therefore, my schema.js, looks something like this: ` const { gql } = require("apollo-server");
const user = require("./models/user/user.schema");
const root = gql` type Query { root: String }
type Mutation { root: String } `;
module.exports = [root, user];
`
User.js `const { gql } = require("apollo-server"); const user = gql' extend type Query { getCurrentUser: User } extend type Mutation { signupUser(username: String!, email: String!, password: String!): AuthToken signinUser(username: String!, password: String!): AuthToken } type AuthToken { token: String! } type User { _id: ID username: String! password: String! email: String! joinDate: String tokens: [Token] } ';
module.exports = user;`
Issue is that, when I try to build like this
const typeDefs = require('./schema.js'); let tester = new EasyGraphQLTester(typeDefs);
This returns an error saying
I think the issue is with the syntax extend type Query.
Is there a workaround?