Base package for @dreamit/graphql-server. Contains constants and interfaces that can be used in graphql-server and extensions.
npm install --save @dreamit/graphql-server-base
TypeScript declarations are provided within the project.
Note:
If you want to publish your own extension it is advised to install @dreamit/graphql-server-base as peerDependency. This way you can define which version range your extension supports and it might be usable in multiple major versions of @dreamit/graphql-server (if they depend on the same range of this base module). Example in package.json for peerDependencies:
"peerDependencies": {
"@dreamit/graphql-server-base": "^1.0.0"
}
@dreamit/graphql-server-base is compatible with graphql-js version ^16.0.0 and funpara version ^1.0.0. For compatibility with @dreamit/graphql-server please check Compatibility section in the graphql-server readme.
All content of this module is exported in the root index.ts file. This means you can import it using an import statement like
import { MetricsClient } from '@dreamit/graphql-server-base'
In error/ErrorNameConstants.ts constants to identify/display errors are provided. In request/ContentType.ts the content type used by @dreamit/graphql-server is available as type.
Interfaces for creating your own Logger or MetricsClient are available in this module. Additionally, the interfaces used by @dreamit/graphql-server for handling requests and responses are provided. For validation and Standard Schema support the StandardSchemaV1 interface is contained in the project and exported.
The NoLogger
class in the @dreamit/graphql-testing library can be used as an example on how to implement the Logger
interface.
If you have questions or issues please visit our Issue page and open a new issue if there are no fitting issues for your topic yet.
graphql-server is under MIT-License.