@fougere/adapter-graphql
Entity → GraphQL types, inputs and CRUD, through Pothos.
Use it
npm install @fougere/adapter-graphql @pothos/core graphql
pnpm add @fougere/adapter-graphql @pothos/core graphql
bun add @fougere/adapter-graphql @pothos/core graphql
yarn add @fougere/adapter-graphql @pothos/core graphql
// fougere.config.ts
import '@fougere/adapter-graphql';
export default defineFougere({
protocols: { graphql: {} },
});
The import is what makes the word exist: without it, the editor and the boot both refuse it.
// fronds/blog/frond.config.ts
export default defineFrond({
operations: { 'post.list': { graphql: { … } } },
});
Every key each one admits: protocols.
What it extends
The interfaces of Fougere this package adds its words to, with declare module — see Interfaces to extend.
| interface | adds |
|---|---|
FougereProtocols | graphql |
FougereOperationProtocols | graphql |
Entries: @fougere/adapter-graphql · @fougere/adapter-graphql/pothos
What you import
| name | |
|---|---|
registerAll | Auto-register GraphQL types and operations from a fougere App. |
schemaOf | The app's schema, derived and kept. |
executeOn | Execute a query against the app's own operations. |
graphqlDoor | GraphQL's door over one schema: one call per root field and per relation, all within this request. |
Types
TypeScript types only — they do not run. Import them with import type to type your own code: a variable, a parameter, an option object.
| name | |
|---|---|
GraphQLDocument | |
GraphQLReceived | What a host hands the GraphQL door — the document still to read, so the door reads it. |