@pequehq/graphql
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Peque GraphQL

CI coverage

Peque GraphQL is an OOP transposition for Apollo Server Resolver.

Install

npm install @pequehq/graphql reflect-metadata

Note: tsconfig's compilerOptions must have both experimentalDecorators and emitDecoratorMetadata set to true.

Example

import { Resolver, ResolverService } from '@pequehq/graphql';

@Resolver()
class ResolverExample {
  @Query()
  countries(@Args('continent') continent: string): unknown {
    return [
      { id: 1, name: 'italy', continent: 'europe' },
      { id: 2, name: 'spain', continent: 'europe' },
      { id: 3, name: 'china', continent: 'asia' },
    ].filter((country) => country.continent === continent);
  }
}

const resolverService = new ResolverService();

const resolvers = resolverService.get([new ResolverExample()]);

// Add resolvers to your Apollo Server integration.

Readme

Keywords

none

Package Sidebar

Install

npm i @pequehq/graphql

Weekly Downloads

2

Version

1.0.6

License

ISC

Unpacked Size

214 kB

Total Files

110

Last publish

Collaborators

  • alesmit
  • simonedicicco