Giter VIP home page Giter VIP logo

Comments (4)

kaustavghosh06 avatar kaustavghosh06 commented on June 15, 2024

@oste You can get rid of the type generated when editing the schema before pushing. That would make sure that a table is not generated.

from amplify-category-api.

oste avatar oste commented on June 15, 2024

@kaustavghosh06 I actually tried this before running amplify api add-graphql-datasource and was given this error

    at syntaxError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/error/syntaxError.js:24:10)
    at unexpected (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/language/parser.js:1322:33)
    at parseDefinition (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/language/parser.js:152:9)
    at parseDocument (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/language/parser.js:110:22)
    at Object.parse (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/language/parser.js:38:10)
    at datasourceSelectionPrompt.then.then.then (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-api/commands/api/add-datasource.js:111:46)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
There was an error adding the datasource```

Will try to do that after adding the aurora data source. Thanks!

from amplify-category-api.

Collin-St avatar Collin-St commented on June 15, 2024

I am also running into this bug. I am attempting to add an existing aurora-serverless datasource with the amplify api add-graphql-datasource command. I am given this error after removing amplify's default custom type MyType and then running the command, similar to above:

GraphQLError: Syntax Error: Unexpected <EOF> at syntaxError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/error/syntaxError.js:24:10) at unexpected (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/language/parser.js:1322:33) at parseDefinition (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/language/parser.js:152:9) at parseDocument (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/language/parser.js:110:22) at Object.parse (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/graphql/language/parser.js:38:10) at datasourceSelectionPrompt.then.then.then (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-api/commands/api/add-datasource.js:108:46) at <anonymous> at process._tickDomainCallback (internal/process/next_tick.js:228:7) There was an error adding the datasource

Update:
I had to work around this by letting amplify add api create a custom type MyType for me, then running amplify api add-graphql-datasource, then removing all references to MyType, and finally running amplify push. I also was getting odd errors of resources not being found, and after some digging it turned out to be amplify naming my resources incorrectly due to punctuation in my RDS schema.

Template format error: Resource name order_itemsCreateResolver is non alphanumeric.

Resource Name: auditListResolver (AWS::AppSync::Resolver) Event Type: create Reason: No field named listAudits found on type Query

So I had to go edit my MySQL schema in RDS, beginning each table name with a capital letter, and not using any non-alphanumeric characters. THEN, push could complete, and generate GraphQL operations for me in the process.

from amplify-category-api.

renebrandel avatar renebrandel commented on June 15, 2024

This issue should be addressed in your new integration with MySQL / PostgreSQL https://docs.amplify.aws/react/build-a-backend/graphqlapi/connect-api-to-existing-database/

from amplify-category-api.

Related Issues (20)

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.