I am trying to create a custom source plugin and am trying to use the addThirdPartySchema method, I tried with this simple example below but receive this error:
Error: Cannot create as TypeComposer the following value: Test.
import * as graphql from "graphql";
import { SourceNodesArgs } from "gatsby";
export const sourceNodes = function sourceNodes(args: SourceNodesArgs) {
const { addThirdPartySchema } = args.actions;
const schema = new graphql.GraphQLSchema({
query: new graphql.GraphQLObjectType({
name: "Test",
fields: {
test: {
type: graphql.GraphQLString,
resolve: () => "hello",
},
},
}),
});
addThirdPartySchema({
schema,
});
};