0.8.1-pull28.1 • Published 1 year ago

@enalmada/pothos-plugin-effect v0.8.1-pull28.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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

0.8.1-pull28.1

1 year ago