# Design URL: /docs/design Design overview for Pothos *** title: Design description: Design overview for Pothos --------------------------------------- ## Type System The type system that powers most of the Pothos type checking has 2 components. The first is the SchemaTypes type param passed into the SchemaBuilder. This allows a shared set of types to be reused throughout the schema, and is responsible for providing type information for shared types like the [Context](./guide/context) object, and any Object, Interface, or Scalar types that you want to reference by name (as a string). Having all type information in a single object can be convenient at times, but with large schemas, can become unwieldy. To support a number of additional use cases, including Unions and Enums, large schemas, and plugins that use extract type information from other sources (eg the Prisma, or the simple-objects plugin), Pothos has another way of passing around type information. This system is based in `Ref` objects that contain the type information it represents. Every builder method for creating a type or a field returns a `Ref` object. Using Ref objects allows us to separate the type information from the implementation, and allows for a more modular design. # Overview URL: /docs Pothos - A plugin based GraphQL schema builder for typescript *** title: Overview description: Pothos - A plugin based GraphQL schema builder for typescript -------------------------------------------------------------------------- ![Pothos](/assets/logo-name-auto.svg) Pothos is a plugin based GraphQL schema builder for typescript. It makes building graphql schemas in typescript easy, fast and enjoyable. The core of Pothos adds 0 overhead at runtime, and has `graphql` as its only dependency. Pothos is the most type-safe way to build GraphQL schemas in typescript, and by leveraging type inference and typescript's powerful type system Pothos requires very few manual type definitions and no code generation. Pothos has a unique and powerful plugin system that makes every plugin feel like its features are built into the core library. Plugins can extend almost any part of the API by adding new options or methods that can take full advantage of the Pothos type system. ## Hello, World ```typescript import { createYoga } from 'graphql-yoga'; import { createServer } from 'node:http'; import SchemaBuilder from '@pothos/core'; const builder = new SchemaBuilder({}); builder.queryType({ fields: (t) => ({ hello: t.string({ args: { name: t.arg.string(), }, resolve: (parent, { name }) => `hello, ${name || 'World'}`, }), }), }); const yoga = createYoga({ schema: builder.toSchema(), }); const server = createServer(yoga); server.listen(3000, () => { console.log('Visit http://localhost:3000/graphql'); }); ``` ## What sets Pothos apart * Pothos was built from the start to leverage typescript for best-in-class type-safety. * Pothos has a clear separation between the shape of your external GraphQL API, and the internal representation of your data. * Pothos comes with a large plugin ecosystem that provides a wide variety of features while maintaining great interoperability between plugins. * Pothos does not depend on code-generation or experimental decorators for type-safety. * Pothos has been designed to work at every scale from small prototypes to huge Enterprise applications, and is in use at some of the largest tech companies including Airbnb and Netflix. ## Plugins that make Pothos even better # LLM Integration URL: /docs/llms AI-ready routes for LLMs to understand your documentation *** title: LLM Integration description: AI-ready routes for LLMs to understand your documentation ---------------------------------------------------------------------- ## Overview This documentation site provides special routes designed for Large Language Models (LLMs) to better understand and interact with the Pothos documentation. ## Available Routes ### Full Documentation #### [`/llms-full.txt`](/llms-full.txt) A plain text representation of the entire documentation, optimized for LLM consumption. This route concatenates all documentation content into a single, easily parseable text file that includes: * Page titles and URLs * Page descriptions * Full content of each documentation page ### Individual Pages #### `/docs/[path].mdx` Get the MDX content for any individual documentation page in an LLM-friendly format. Simply append `.mdx` to any docs path to retrieve that page's content. in a clean, parseable format # Resources URL: /docs/resources External guides, tools, and libraries created by members of the Pothos community. *** title: Resources description: External guides, tools, and libraries created by members of the Pothos community. ---------------------------------------------------------------------------------------------- ## Guides and Tutorials * [End-To-End Type-Safety with GraphQL, Prisma & React: GraphQL API](https://www.prisma.io/blog/e2e-type-safety-graphql-react-3-fbV2ZVIGWg#start-up-a-graphql-server) by [Sabin Adams](https://twitter.com/sabinthedev) * [Code-first GraphQL with Pothos](https://graphql.wtf/episodes/60-code-first-graphql-with-pothos) by [Jamie Barton](https://twitter.com/notrab) * [How to Build a Type-safe GraphQL API using Pothos and Kysely](https://dev.to/franciscomendes10866/how-to-build-a-type-safe-graphql-api-using-pothos-and-kysely-4ja3) by [Francisco Mendes](https://github.com/FranciscoMendes10866) * [Type-safe GraphQL Server with Pothos](https://omkarkulkarni.hashnode.dev/type-safe-graphql-server-with-pothos-formerly-giraphql) by [Omkar Kulkarni](https://twitter.com/omkar_k45) * [Build a GraphQL server running on Cloudflare Workers](https://the-guild.dev/blog/graphql-yoga-worker) by [Rito Tamata](https://twitter.com/chimame_rt) ## 3rd party Tools and Libraries * [Prisma Generator Pothos Codegen](https://github.com/Cauen/prisma-generator-pothos-codegen) by [Emanuel](https://twitter.com/cauenor) * [Nexus to Pothos codemod](https://github.com/villesau/nexus-to-pothos-codemod) by [Ville Saukkonen](https://twitter.com/SaukkonenVille) * [protoc-gen-pothos](https://github.com/proto-graphql/proto-graphql-js/tree/main/packages/protoc-gen-pothos) by [Masayuki Izumi](https://twitter.com/izumin5210) * [@smatch-corp/nestjs-pothos](https://github.com/smatch-corp/nestjs-pothos) by [Chanhee Lee](https://github.com/iamchanii) * [pothos-protoc-gen](https://iamchanii.github.io/pothos-protoc-gen/) by [Chanhee Lee](https://github.com/iamchani) * [rumble](https://github.com/m1212e/rumble) (GraphQL + Drizzle + Abilities ) by [m1212e](https://github.com/m1212e) [(introduction)](https://github.com/hayes/pothos/discussions/1414) ## Templates and Examples * [Pothos GraphQL Server](https://github.com/theogravity/graphql-pothos-server-example) by [Theo Gravity](https://github.com/theogravity) * [GraphQL countries server ](https://github.com/gbicou/countries-server) by [Benjamin VIELLARD](https://github.com/gbicou) * [datalake-graphql-wrapper](https://github.com/dbsystel/datalake-graphql-wrapper) by [noxify](https://github.com/noxify) ## Conference talks * [Pothos + Prisma: delightful, type-safe and efficient GraphQL](https://www.youtube.com/watch?v=LqKPfMmxFxw) by [Michael Hayes](https://twitter.com/yavascript) ## Paid tools * [Bedrock](https://bedrock.mxstbr.com/) by [Max Stoiber](https://twitter.com/mxstbr) * [nytro](https://www.nytro.dev/) by [Jordan Gensler](https://twitter.com/vapejuicejordan) # Sponsors URL: /docs/sponsors The generous people supporting Pothos development *** title: Sponsors description: The generous people supporting Pothos development -------------------------------------------------------------- Pothos development supported by [sponsorships](https://github.com/sponsors/hayes) from these generous people and organizations: * * * * * [@saevarb](https://github.com/saevarb) * [@seanaye](https://github.com/seanaye) * [@arimgibson](https://github.com/arimgibson) * [@ccfiel](https://github.com/ccfiel) * [@JoviDeCroock](https://github.com/JoviDeCroock) * [@hellopivot](https://github.com/hellopivot) * [@robmcguinness](https://github.com/robmcguinness) * [@Gomah](https://github.com/Gomah) * * [@garth](https://github.com/garth) * [@lifedup](https://github.com/lifedup) * [@skworden](https://github.com/skworden) * [@jacobgmathew](https://github.com/jacobgmathew) * [@aniravi24](https://github.com/aniravi24) * [@mizdra](https://github.com/mizdra) * [@3nk1du](https://github.com/3nk1du) * [@FarazPatankar](https://github.com/FarazPatankar) * [@noxify](https://github.com/noxify) * [@matthawk60](https://github.com/matthawk60) * [@BitPhinix](https://github.com/BitPhinix) * [@nathanchapman](https://github.com/nathanchapman) * [@pradyuman](https://github.com/pradyuman) * [@tmm](https://github.com/tmm)