1.1.7 • Published 4 years ago

nestjs-graphql-gateway v1.1.7

Weekly downloads
204
License
MIT
Repository
github
Last release
4 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

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4-beta.31

4 years ago

1.1.4-beta.30

4 years ago

1.1.4-beta.29

4 years ago

1.1.4-beta.28

4 years ago

1.1.4-beta.27

4 years ago

1.1.4-beta.25

4 years ago

1.1.4-beta.24

4 years ago

1.1.4-beta.23

4 years ago

1.1.4-beta.22

4 years ago

1.1.4-beta.21

4 years ago

1.1.4-beta.20

4 years ago

1.1.4-beta.18

4 years ago

1.1.4-beta.17

4 years ago

1.1.4-beta.16

4 years ago

1.1.4-beta.15

4 years ago

1.1.4-beta.14

4 years ago

1.1.4-beta-12

4 years ago

1.1.4-beta-11

4 years ago

1.1.4-beta-10

4 years ago

1.1.4-beta-9

4 years ago

1.1.4-beta-8

4 years ago

1.1.4-beta-7

4 years ago

1.1.4-beta-6

4 years ago

1.1.4-beta-5

4 years ago

1.1.4-beta-4

4 years ago

1.1.4-beta-3

4 years ago

1.1.4-beta-2

4 years ago

1.1.4-beta-1

4 years ago

1.1.4-alpha-1

4 years ago

1.1.4

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago