@enalmada/pothos-plugin-effect
TypeScript icon, indicating that this package has built-in type declarations

0.8.1-pull28.1 • Public • Published

pothos-plugin-effect

Seamless integration between the Pothos GraphQL and Effect.

Hello World!

import SchemaBuilder from '@pothos/core';
import EffectPlugin from 'pothos-plugin-effect';
import { Effect, Random } from 'effect';

const builder = new SchemaBuilder({
  plugins: [EffectPlugin],
});

builder.queryFields(t => ({
  roll: t.effect({
    type: 'Int',
    resolve() {
      // $ExpectType Effect.Effect<never, never, number>
      return Random.nextIntBetween(1, 6);
    },
  }),
}));

Documentations

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)

Contributors

Made with contrib.rocks.

Licenses

MIT

Readme

Keywords

Package Sidebar

Install

npm i @enalmada/pothos-plugin-effect

Weekly Downloads

2

Version

0.8.1-pull28.1

License

MIT

Unpacked Size

55.1 kB

Total Files

18

Last publish

Collaborators

  • enalmada