Skip to content

Commit

Permalink
fix: codegen after mergining schema
Browse files Browse the repository at this point in the history
  • Loading branch information
kespinola committed Apr 24, 2023
1 parent d165f07 commit cc04a01
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,36 @@ import * as dotenv from "dotenv";

dotenv.config();

const holaplexSchema = {
[process.env.HOLAPLEX_API_ENDPOINT as string]: {
headers: {
Authorization: process.env.HOLAPLEX_AUTH_TOKEN as string,
},
},
};

const config: CodegenConfig = {
overwrite: true,
documents: ["**/*.graphql"],
schema: [holaplexSchema, "./schema.graphql"],
schema: [
{
[process.env.HOLAPLEX_API_ENDPOINT as string]: {
headers: {
Authorization: process.env.HOLAPLEX_AUTH_TOKEN as string,
},
},
},
"./schema.graphql",
],
generates: {
"./holaplex.graphql": {
schema: {
[process.env.HOLAPLEX_API_ENDPOINT as string]: {
headers: {
Authorization: process.env.HOLAPLEX_AUTH_TOKEN as string,
},
},
},
plugins: ["schema-ast"],
},
"./@types/graphql.d.ts": {
plugins: ["typescript-graphql-files-modules"],
},
"./src/graphql.types.ts": {
plugins: ["typescript", "typescript-resolvers"],
},
"./holaplex.graphql": {
schema: holaplexSchema,
plugins: ["schema-ast"],
},
},
};
export default config;

0 comments on commit cc04a01

Please sign in to comment.