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
TypeError: Must provide Source. Received: { kind: "Document", definitions: [[Object], [Object]], loc: [Object] }
I think the issue is with the syntax extend type Query.
Is there a workaround?