I am having a very hard time trying to find out why my PageType on "page/pages" is giving "PageType is not defined", is there a different way I am suppose to reference it? I have a feeling this may be a simple overlook with how to reference other types
const PageType = new GraphQLObjectType({
name: 'Page',
fields: {
_id: { type: new GraphQLNonNull(GraphQLID) },
title: { type: GraphQLString },
subtitle: { type: GraphQLString },
description: { type: GraphQLString },
page: {
type: PageType
}
pages: {
type: new GraphQLList(PageType),
}
},
});
Error (Mainly to help others search a similar problem):
ReferenceError: PageType is not defined
at Object.<anonymous> (H:\Coding\Projects\react-starter-kit\build\webpack:\src\data\types\PageType.js:50:1)
at __webpack_require__ (H:\Coding\Projects\react-starter-kit\build\webpack:\webpack\bootstrap 8ce5b4572987765a465d:19:1)
at Object.<anonymous> (H:\Coding\Projects\react-starter-kit\build\server.js:731:74)
at __webpack_require__ (H:\Coding\Projects\react-starter-kit\build\webpack:\webpack\bootstrap 8ce5b4572987765a465d:19:1)
at Object.<anonymous> (H:\Coding\Projects\react-starter-kit\build\webpack:\src\data\schema.js:1:1)
at __webpack_require__ (H:\Coding\Projects\react-starter-kit\build\webpack:\webpack\bootstrap 8ce5b4572987765a465d:19:1)
at Object.<anonymous> (H:\Coding\Projects\react-starter-kit\build\server.js:1098:72)
at __webpack_require__ (H:\Coding\Projects\react-starter-kit\build\webpack:\webpack\bootstrap 8ce5b4572987765a465d:19:1)
at Object.<anonymous> (H:\Coding\Projects\react-starter-kit\build\server.js:7455:18)
at __webpack_require__ (H:\Coding\Projects\react-starter-kit\build\webpack:\webpack\bootstrap 8ce5b4572987765a465d:19:1)
at H:\Coding\Projects\react-starter-kit\build\webpack:\webpack\bootstrap 8ce5b4572987765a465d:65:1
at Object.<anonymous> (H:\Coding\Projects\react-starter-kit\build\server.js:71:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)