@fougere/adapter-graphql

Entity → GraphQL types, inputs and CRUD, through Pothos.

Use it

npm install @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.

interfaceadds
FougereProtocolsgraphql
FougereOperationProtocolsgraphql

Entries: @fougere/adapter-graphql · @fougere/adapter-graphql/pothos

What you import

name
registerAllAuto-register GraphQL types and operations from a fougere App.
schemaOfThe app's schema, derived and kept.
executeOnExecute a query against the app's own operations.
graphqlDoorGraphQL'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
GraphQLReceivedWhat a host hands the GraphQL door — the document still to read, so the door reads it.
Built with Fougere and Nuxt, hosted on GitHub Pages.