Code Monkey home page Code Monkey logo

graphql-ttl-transformer's Introduction

graphql-ttl-transformer's People

Contributors

flogy avatar hisham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

graphql-ttl-transformer's Issues

AWS Amplify Build - Cannot Find graphql-ttl-transformer

Hello,

  1. I have read this article offering a build solution.
  2. I have added this to my transform.conf.json file "transformers": ["graphql-ttl-transformer"]
  3. I have installed this package on my project "graphql-ttl-transformer": "^2.0.0",
  4. The localhost ttl fields via graphql schema work and show in DynamoDB
  5. I am using Next.js and AWS Amplify
  6. I am using "transformerversion": 2 in the cli.json file.

Error:
🛑 Unable to import custom transformer module(graphql-ttl-transformer).
🛑 You may fix this error by editing transformers at graphql-ttl-transformer/transform.conf.json
✖ An error occurred when pushing the resources to the cloud
✖ There was an error initializing your environment.
Cannot find module '/root/.amplify/lib/node_modules/graphql-ttl-transformer'

Build File for AWS Amplify Hosting:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm install 
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

AWSTimestamp instead of Int

Thanks a lot!
One small remark: Isn't it more appropriate to use the AWSTimestamp scalar type instead of Int?

Unable to get my Amplify to see the plugin

Hello! :)
I'm trying to add the plugin to my Amplify environment, I'm using version 2 of the transformer.
I followed the instructions and added it by running npm install --save graphql-ttl-transformer and then edited the amplify/backend/api/<YOUR_API>/transform.conf.json file, as instructed.
However, I get the error below in response.

Screen Shot 2022-08-31 at 6 06 37 PM

Furthermore, I tried adding the plugin manually with the command amplify plugin add and the I provided the absolute path to the plugin and I received the following error.

Screen Shot 2022-08-31 at 6 08 57 PM

Any advice? I'm using Amplify version 9.2.1.

Ready this transformer plugin for GraphQL Transformer v2

👋 This is Rene from the AWS Amplify team! First off, THANK YOU for your amazing plugin!

I have some great news to share, we've rewritten the GraphQL Transformer plugin from the ground up to take advantage of some really amazing capabilities. All the details here: aws-amplify/amplify-cli#6217 (comment)

How to migrate your plugin to GraphQL Transformer v2

In order to make this plugin forward compatible with GraphQL Transformer v2, you need to make some tiny adjustments to the classes you inherit from. Migration steps here: https://gist.github.com/renebrandel/0b9537e2016e3dd9ed6d794b30b2e3f4

Happy to also hop on a call with you to walk you through the process. Email me at any time: renbran at amazon dot com

Build failure: "Unable to import custom transformer module(graphql-ttl-transformer)"

Hi and thanks for this transformer,

I have followed your npm install instruction and also added a transformers field with graphql-ttl-transformer to transform.conf.json like this:

{
    "Version": 5,
    "ElasticsearchWarning": true,
    "transformers": [
        "graphql-ttl-transformer"
    ]
}

I can successfully deploy the backend with amplify push but when I try to deploy the frontend, the build fails with the following warning: Unable to import custom transformer module(graphql-ttl-transformer).

Here is the relevant part of the build log.

2021-01-19T12:01:24.851Z [INFO]: �[31mUnable to import custom transformer module(graphql-ttl-transformer).�[39m
2021-01-19T12:01:24.852Z [INFO]: �[31mYou may fix this error by editing transformers at /codebuild/output/src127667145/src/janky-app/amplify/backend/api/janky/transform.conf.json�[39m
2021-01-19T12:01:24.852Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud
2021-01-19T12:01:24.852Z [WARNING]: ✖ There was an error initializing your environment.
2021-01-19T12:01:24.854Z [INFO]: �[31minit failed�[39m
2021-01-19T12:01:24.855Z [INFO]: �[0m/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/import-global/index.js:1�[0m
                                 �[0mError: Cannot find module '/root/.nvm/versions/node/v12.19.0/lib/node_modules/graphql-ttl-transformer'�[0m
                                 �[0mRequire stack:�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/import-global/index.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/transform-graphql-schema.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/amplify-service-migrate.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/initializer.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/index.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/lib/init-steps/s2-initProviders.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/lib/commands/init.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/lib/index.js�[0m
                                 �[0m- /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/bin/amplify�[0m
                                 �[0m    at Object.module.exports [as default] (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/import-global/index.js:9:10)�[0m
                                 �[0m    at /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/transform-graphql-schema.ts:111:44�[0m
                                 �[0m    at Array.map (<anonymous>)�[0m
                                 �[0m    at Object.transformersFactory (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/transform-graphql-schema.ts:80:8) {�[0m
                                 �[0m  code: 'MODULE_NOT_FOUND',�[0m
                                 �[0m  requireStack: [�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/import-global/index.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/transform-graphql-schema.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/amplify-service-migrate.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/initializer.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/index.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/lib/init-steps/s2-initProviders.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/lib/commands/init.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/lib/index.js',�[0m
                                 �[0m    '/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/bin/amplify'�[0m
                                 �[0m  ]�[0m
                                 �[0m}�[0m
2021-01-19T12:01:24.871Z [ERROR]: !!! Build failed
2021-01-19T12:01:24.872Z [ERROR]: !!! Non-Zero Exit Code detected
2021-01-19T12:01:24.872Z [INFO]: # Starting environment caching...
2021-01-19T12:01:24.872Z [INFO]: # Environment caching completed
Terminating logging...

Any help much appreciated! Thanks

Question!

Hi, thank you for writing this!

Question for you - is the int option saying I can have a "dynamic" ttl like 30 days, instead of a specific timestamp? What would the units be there?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.