1.1.7 • Published 5 years ago

nestjs-graphql-gateway v1.1.7

Weekly downloads
204
License
MIT
Repository
github
Last release
5 years ago

Installation

$ yarn install nestjs-graphql-gateway

Setup federated service

import { Module } from '@nestjs/common';
import { GraphqlDistributedModule } from 'nestjs-graphql-gateway';

@Module({
  imports: [
    GraphqlDistributedModule.forRoot({
      typePaths: [path.join(process.cwd() + '/apps/service-auth/src', '/**/*.graphql')],
      introspection: true,
      playground: {
        workspaceName: 'GRAPHQL CQRS',
        settings: {
          'editor.theme': 'light',
        },
      },
      context: (ctx) => ctx,
    })
  ]
})
export class AppModule {}


// Code first TypegraphQl

@Module({
  imports: [
    GraphqlDistributedModule.forRoot({
      autoSchemaFile: 'graphs/demo.gql',
      
      // optional orphaned types
      buildSchemaOptions: {
        orphanedTypes: [Tenant, TenantMember, User],
      },
      
      context: (ctx) => ctx,
    })
  ]
})
export class AppModule {}

Setup Gateway

import { Module } from '@nestjs/common';
import { GraphqlDistributedGatewayModule } from 'nestjs-graphql-gateway';

@Module({
  imports: [
    GraphqlDistributedGatewayModule.forRoot({
      subscriptions: false,
      path: '/graphql',
      context: context => context,
      serviceList: [
        { name: 'auth', url: 'http://localhost:1000/graphql' },
        { name: 'user', url: 'http://localhost:2000/graphql' },
        // more services
      ],
      buildService({ url }) {
        return new HeadersDatasource({ url });
      },
    }),
  ]
})
export class AppModule {}

License

This project is MIT licensed.

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

6 years ago

1.1.4-beta.31

6 years ago

1.1.4-beta.30

6 years ago

1.1.4-beta.29

6 years ago

1.1.4-beta.28

6 years ago

1.1.4-beta.27

6 years ago

1.1.4-beta.25

6 years ago

1.1.4-beta.24

6 years ago

1.1.4-beta.23

6 years ago

1.1.4-beta.22

6 years ago

1.1.4-beta.21

6 years ago

1.1.4-beta.20

6 years ago

1.1.4-beta.18

6 years ago

1.1.4-beta.17

6 years ago

1.1.4-beta.16

6 years ago

1.1.4-beta.15

6 years ago

1.1.4-beta.14

6 years ago

1.1.4-beta-12

6 years ago

1.1.4-beta-11

6 years ago

1.1.4-beta-10

6 years ago

1.1.4-beta-9

6 years ago

1.1.4-beta-8

6 years ago

1.1.4-beta-7

6 years ago

1.1.4-beta-6

6 years ago

1.1.4-beta-5

6 years ago

1.1.4-beta-4

6 years ago

1.1.4-beta-3

6 years ago

1.1.4-beta-2

6 years ago

1.1.4-beta-1

6 years ago

1.1.4-alpha-1

6 years ago

1.1.4

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago