What I expect: After typing amplify codegen models, it should generate the model "classes" for my already existing backend.
What happens: Message Output:
No AppSync API configured. Please add an API.
What I did so far:
Already did the Amplify Prerequisites mentioned here
I added my existing API to my Android Project by amplify codegen
That resulted in generated files for mutations/queries/subscriptions and the schema.json as you can see on the screenshot below.
I wanted to generate the models classes as mentioned here
But as said, the model classes are not generated. May someone has the solution for my situation out there. Would help me a lot :)
amplify codegen models uses CLI codegen to generate models to be used for the new Amplify API and Amplify DataStore categories, which is separate from the generated code used by the AppSync client.
To generate models for Amplify API, try using the following command: amplify add api, to add a new API. When prompted to edit your models, follow the instructions to edit the schema.graphql file in specified path.
If you try amplify codegen models at this point, then you will find that the models are generated.
Related
I'm exploring using AWS Amplify for a personal project. I'm finding many tutorials for data binding, using collections, building forms with the Amplify UI... all features that I am excited to use. However, I'm struggling to figure out how to use many of Amplify Studio's features without enabling Amplify DataStore, a feature that I do not need for my project (and would prefer the simplicity of an architecture without it).
I can't seem to find any documentation anywhere (in AWS docs, stackoverflow answers, google searches...) that says enabling DataStore is required to bind my models to my UI components using Amplify's UI Library.
The only message that comes close is Enable DataStore to edit your data model visually on the Data tab in Amplify Studio, suggesting that enabling DataStore is required to modify the schema.graphql file using the UI, which feels very arbitrary to me.
I can't understand why DataStore would be mandatory for so many of Amplify Studio's features, and since I can't find any documentation specifying this... I feel like I'm misunderstanding something. But Amplify Studio also seems to be hinting that DataStore is indeed required.
Can I leverage AWS Amplify Studio's UI Library feature to bind my UI components to my data models without enabling DataStore?
Digging more through the AWS documentation, I came across this:
https://docs.amplify.aws/console/data/data-model/#data-modeling-in-amplify-studio
All data models built with Studio work with Amplify DataStore out-of-the-box.
Another way to word that could be:
Building a data model with Amplify Studio requires enabling Amplify DataStore for your project.
Looks like I have to accept enabling Amplify DataStore for my project in order to leverage the rest of Amplify Studio's features.
When playing around with the Amplify settings, I discover the Amplify Studio.
There you could use DataStore for the existing project but that polluted my generated types for the project.
I can manually delete all _version and other keys, but when running amplify codegen -> the unwanted keys will be back.
I want to remove DataStore from my project but I can't find how?
You can run amplify api remove in your project root folder.
The other option might be to remove backend from Amplify Console(this is eu-central-1 region, select your region), select your app, select backend environment and there is option 'delete' from dropdown menu
I was recently able to accomplish this by doing the following:
First run: amplify update api
Select from one of the below mentioned services: GraphQL
Select a setting to edit: Disable conflict detection
Update API: amplify push
After the update the _version and _lastChangedAt fields were still on the DynamoDB objects, but you can manually remove those if you want them gone.
I currently have a server build process that uses Terraform and deploys a server all from code.
I'm looking for a web UI with forms that I could either populate specific fields and or do API get commands against a VCenter or wherever the server is being built to populate the specific fields. The fields that get populated would be stored as the variables.tf file and when someone hits submit, it would run the actual Terraform command terraform apply to build the server based on the variables. My guess is the terraform binaries would have to live on there so it could run in the background.
It doesn't have to be some super fancy web page, just something that I could potentially make look cool for Director level folks.
Also, I don't want to use TF enterprise, yet. I've looked into a couple of open source projects (atlantis and terrahub) but none seem to be what I'm looking for.
I'm far from a web developer so any help would be awesome.
You can try with SLD
Stack-Lifecycle-Deployment
I think it has everything that you need
It is very intuitive, it has a web interface and a rest api to easily integrate it with the rest of the applications.
I'm considering using GraphQL with a Django backend service but I couldn't find much information regarding the API documentation. I need some solution to dynamically generate the documentation, perhaps like npm's graphql-docs with a result similar to GitHub's API docs.
Is it feasible to accomplish with graphene-django? If not, what's a good alternative for a python environment?
Yes, it's very easy to do by using GraphiQL, which is embedded in to Graphene.
The instructions on how to integrate this with Graphene are here in the graphene-python documentation. --- basically you need to add the parameter graphiql=True when setting up the API route in your urls.py file.
After it is set up, if go to your API endpoint in your browser, you'll see a nice interface for sending API calls, getting API responses, and reading documentation for both queries and mutations. The documentation is initially hidden on the right until you click on the "< Docs" link.
Mashery iodocs is a tool for documenting API. It needs two configuration json objects to run. It would be nice to have this objects generated automatically by tastypie. Tastypie can generate json with schema, however it's incompatible with iodocs expectations. Any ideas of how to generate this configurtion automatically using tastypie?
Presently, I do not believe there is a way to generate that kind of documentation from TastyPie directly. However, I have found this project useful in creating interactive API documentation.
https://github.com/Hipo/Django-API-Playground
One more project to generate documentation automatically - https://github.com/minism/django-tastypie-swagger
Though so far I haven't find anything convincing!