Skip to content

Commit

Permalink
feat: add @PrimaryKey directive to Transformer v2 (aws-amplify#7797)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig authored and akshbhu committed Aug 15, 2021
1 parent 84b2b57 commit 2b21375
Show file tree
Hide file tree
Showing 16 changed files with 5,051 additions and 0 deletions.
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

0 comments on commit 2b21375

Please sign in to comment.