import { Application , Binding , Component , CoreBindings , createBindingFromClass , inject , } from '@loopback/core' ; import { GraphQLResolverBooter } from './booters/resolver.booter' ; import { GraphQLServer } from './graphql.server' ; import { GraphQLBindings } from './keys' ; /**
 * Component for GraphQL
 */ export class GraphQLComponent implements Component { bindings : Binding [ ] = [ createBindingFromClass ( GraphQLServer ) , createBindingFromClass ( GraphQLResolverBooter ) , ] ; constructor ( @ inject ( CoreBindings . APPLICATION_INSTANCE ) app ) { app . configure ( GraphQLBindings . GRAPHQL_SERVER ) . toAlias ( GraphQLBindings . CONFIG ) ; } }