Skip to content

Commit

Permalink
feat: split holaplex schema out from the app schema. auto download th…
Browse files Browse the repository at this point in the history
…e latest schema through introspection query when run codegen.
  • Loading branch information
kespinola committed Apr 23, 2023
1 parent 4e95103 commit 24e4324
Show file tree
Hide file tree
Showing 8 changed files with 1,589 additions and 1,185 deletions.
23 changes: 13 additions & 10 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,29 @@ 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: [
{
[process.env.HOLAPLEX_API_ENDPOINT as string]: {
headers: {
Authorization: process.env.HOLAPLEX_AUTH_TOKEN as string,
},
},
},
"./schema.graphql"
],
schema: [holaplexSchema, "./app.graphql"],
generates: {
"./@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;
Loading

0 comments on commit 24e4324

Please sign in to comment.