pothos-plugin-effect
pothos-plugin-effect copied to clipboard
✨ Perfect ✨ combination of Pothos GraphQL and Effect. This powerful combination will take your GraphQL development experience to the next level!
pothos-plugin-effect
✨ Perfect ✨ combination of Pothos GraphQL and Effect. This powerful combination will take your GraphQL development experience to the next level!
import EffectPlugin from "pothos-plugin-effect";
import { Random } from "effect";
const builder = new SchemaBuilder({
plugins: [EffectPlugin],
});
builder.queryFields((t) => ({
roll: t.effect({
type: "Int",
resolve: () => Random.nextIntBetween(1, 6),
}),
}));
Installtation
$ yarn add effect pothos-plugin-effect
Documentation
No friendly documentation is currently available, but you can check out the test code below to see how it works in action:
-
Adding and configuring plugins to
SchemaBuilder
-
Adding a field using
t.effect
- Using with the Errors plugin
- Using with the With-Input plugin
- Using with the Prisma
- Using with the Drizzle
-
Adding a subscription field using
Stream
Requirements
-
@pothos/core^3
-
effect>=3.0.0
Acknowledges
- Pothos by @hayes (GitHub/Docs) - A nice GraphQL Schema builder. I heavily relied on the README for this project and The documentation of the plugin implementation is excellent.
- Effect (GitHub/Docs) - This is a pretty amazing growth trend. A library that has the charm to bring you back. (including me, of course)
Contributors
Made with contrib.rocks.
License
MIT