Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thatconference/that-api-schema
Shared schema bits between services (e.g enums)
https://github.com/thatconference/that-api-schema
Last synced: about 13 hours ago
JSON representation
Shared schema bits between services (e.g enums)
- Host: GitHub
- URL: https://github.com/thatconference/that-api-schema
- Owner: ThatConference
- License: gpl-3.0
- Created: 2020-12-17T19:48:09.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-04T17:22:52.000Z (12 months ago)
- Last Synced: 2024-08-09T06:51:13.357Z (3 months ago)
- Language: JavaScript
- Size: 677 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# that-api-schema
> **Warning**: This is v4 of `that-api-schema`. It's intended use is with Apollo server version 3 && 4. It is not compatible with Apollo server v2. V1 of this library is [here](https://github.com/ThatConference/that-api/tree/v1). (There is no v2 of this library) ⚠
Shared schema bits between entity services (e.g enums)
@thatconference/schema
Each exportable schema piece returns a GraphQL DocumentNode which can be merged into the rest of the services schema with `mergeTypeDefs()`. For Example:
```javascript
import path from 'path';
import { loadFilesSync } from '@graphql-tools/load-files';
import { mergeTypeDefs } from '@graphql-tools/merge';
import { productTypeEnum } from '@thatconference/schema';const typesArray = loadFilesSync(path.join(__dirname, './**/*.graphql'));
export default mergeTypeDefs([typesArray, productTypeEnum], { all: true });
```## Publishing new versions
1. ENSURE `package.json` version is updated to new semver value!
1. Create a release in GitHub using `v` + semver value as tag (e.g. `v1.1.0`)
- Add release notes and changes made to this version
1. From local command line at same tag point run `$ npm run npm:publish`
- version is published to [npmjs.com](https://www.npmjs.com/package/@thatconference/schema)