How to use the graphql-transformer-core.SyncUtils.syncResolverConfig function in graphql-transformer-core

To help you get started, we’ve selected a few graphql-transformer-core examples, based on popular ways it is used in public projects.

github aws-amplify / amplify-cli / packages / graphql-dynamodb-transformer / src / resources.ts View on Github external
ref(ResourceConstants.SNIPPETS.ModelObjectKey),
              raw(`$util.toJson(\$${ResourceConstants.SNIPPETS.ModelObjectKey})`),
              obj({
                id: obj({ S: str('$context.args.input.id') }),
              }),
              true
            ),
            condition: ref('util.toJson($condition)'),
            objectKeyVariable: ResourceConstants.SNIPPETS.ModelObjectKey,
            nameOverrideMap: ResourceConstants.SNIPPETS.DynamoDBNameOverrideMap,
            isSyncEnabled,
          }),
        ])
      ),
      ResponseMappingTemplate: isSyncEnabled ? print(DynamoDBMappingTemplate.dynamoDBResponse()) : print(ref('util.toJson($ctx.result)')),
      ...(syncConfig && { SyncConfig: SyncUtils.syncResolverConfig(syncConfig) }),
    });
  }
github aws-amplify / amplify-cli / packages / graphql-dynamodb-transformer / src / resources.ts View on Github external
DynamoDBMappingTemplate.deleteItem({
            key: ifElse(
              ref(ResourceConstants.SNIPPETS.ModelObjectKey),
              raw(`$util.toJson(\$${ResourceConstants.SNIPPETS.ModelObjectKey})`),
              obj({
                id: ref('util.dynamodb.toDynamoDBJson($ctx.args.input.id)'),
              }),
              true
            ),
            condition: ref('util.toJson($condition)'),
            isSyncEnabled,
          }),
        ])
      ),
      ResponseMappingTemplate: isSyncEnabled ? print(DynamoDBMappingTemplate.dynamoDBResponse()) : print(ref('util.toJson($ctx.result)')),
      ...(syncConfig && { SyncConfig: SyncUtils.syncResolverConfig(syncConfig) }),
    });
  }
}
github aws-amplify / amplify-cli / packages / graphql-dynamodb-transformer / src / resources.ts View on Github external
ref(ResourceConstants.SNIPPETS.ModelObjectKey),
                raw(`$util.toJson(\$${ResourceConstants.SNIPPETS.ModelObjectKey})`),
                obj({
                  id: raw(`$util.dynamodb.toDynamoDBJson($util.defaultIfNullOrBlank($ctx.args.input.id, $util.autoId()))`),
                }),
                true
              ),
              attributeValues: ref('util.dynamodb.toMapValuesJson($context.args.input)'),
              condition: ref('util.toJson($condition)'),
            },
            syncConfig ? '2018-05-29' : '2017-02-28'
          ),
        ])
      ),
      ResponseMappingTemplate: syncConfig ? print(DynamoDBMappingTemplate.dynamoDBResponse()) : print(ref('util.toJson($ctx.result)')),
      ...(syncConfig && { SyncConfig: SyncUtils.syncResolverConfig(syncConfig) }),
    });
  }