Using Deno
Pothos is compatible with Deno, and can be used with GraphQL Yoga which now also supports deno!
Imports
There are a number of different ways to import Pothos, but the best option is ussually to set up import maps and import from esm.sh.
Import maps
deno.json
Server
Running the app:
Without import maps
In some cases (like when using the deno deploy playground) you may not be able to use import maps. In this case, you can use query parameters with esm.sh to ensure that shared versions of packages are used:
The @pothos/deno package
The @pothos/deno
package contains a typescript-only version of most of the pothos plugins. This is
no longer the recommended way to use pothos with deno, but will continue to be published with new
changes.
The files for this package are published to npm, and can be consumed from a number of CDNs. The benefit of this is that all plugins are bundled with pothos/core, and import directly so you do not need to mess with dependencies to ensure that plugins are using the correct version of pothos/core.
example
Pothos uses https://cdn.skypack.dev/graphql?dts
which can be added to an import map to import a
different version of graphql.