Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add @primaryKey directive to Transformer v2 #7797

Merged
merged 2 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = {
'<rootDir>/packages/amplify-graphql-docs-generator',
'<rootDir>/packages/amplify-graphql-function-transformer',
'<rootDir>/packages/amplify-graphql-http-transformer',
'<rootDir>/packages/amplify-graphql-index-transformer',
'<rootDir>/packages/amplify-graphql-predictions-transformer',
'<rootDir>/packages/amplify-graphql-searchable-transformer',
'<rootDir>/packages/amplify-graphql-types-generator',
Expand Down
5 changes: 5 additions & 0 deletions packages/amplify-graphql-index-transformer/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/__mocks__/**
**/__tests__/**
src
tsconfig.json
tsconfig.tsbuildinfo
4 changes: 4 additions & 0 deletions packages/amplify-graphql-index-transformer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
13 changes: 13 additions & 0 deletions packages/amplify-graphql-index-transformer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# GraphQL @primaryKey Transformer

# Reference Documentation

### @primaryKey

The `@primaryKey` directive allows you to define the primary key for your relational data.

#### Definition

```graphql
directive @primaryKey(sortKeyFields: [String]) on FIELD_DEFINITION
```
57 changes: 57 additions & 0 deletions packages/amplify-graphql-index-transformer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "@aws-amplify/graphql-index-transformer",
"version": "0.1.0",
"description": "Amplify GraphQL index and key transformers",
"repository": {
"type": "git",
"url": "https://github.com/aws-amplify/amplify-cli.git",
"directory": "packages/amplify-graphql-index-transformer"
},
"author": "Amazon Web Services",
"license": "Apache-2.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"keywords": [
"graphql",
"cloudformation",
"aws",
"amplify"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"clean": "rimraf ./lib",
"test": "jest"
},
"dependencies": {
"@aws-amplify/graphql-transformer-core": "0.7.2",
"@aws-amplify/graphql-transformer-interfaces": "1.7.0",
"@aws-cdk/aws-appsync": "~1.72.0",
"@aws-cdk/aws-dynamodb": "~1.72.0",
"graphql": "^14.5.8",
"graphql-mapping-template": "4.18.1",
"graphql-transformer-common": "4.19.6"
},
"devDependencies": {
"@aws-amplify/graphql-model-transformer": "~0.4.6",
"@aws-cdk/assert": "~1.72.0"
},
"jest": {
"transform": {
"^.+\\.(ts|tsx)?$": "ts-jest"
},
"testRegex": "(src/__tests__/.*.test.ts)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"collectCoverage": true
}
}
Loading