How can I wrap an existing REST API into graphQL API using AWS appsync? - graphql

I am trying to convert my REST API into graphql using AWS app sync, the problem is I am unable to fine the right method or documentation on how to do it.
I have successfully created a schema, I am trying to give a resolver for it, but I am not sure what is the right way to do it.

The problem was the creation of a pipeline, I changed actions > update runtime > Unit Resolver (VTL only). and then selecting the HTTP request as a data source was open for me to use. the document does not seem to have this information, anyways if you play with it for some time, you can get it (quite frustrating, ngl).

Related

Custom Github connector powerapps issue

The issue actually is regarding PowerAutomate (Web version). I am trying to create a custom Github connector as the existing one lacks multiple actions that was needed for my workflow. I setup a simple Get organisation teams API and when I test this action in the builder interface of custom
connector, it works like a charm!!
However when I try to use the same action in a Flow, I encounter the following error:
'The API operation 'GetOrganizationTeams' requires the property 'body/0/parent' to be of type 'String' but is of type 'Object'.
The API documentation for Get Teams can be found here. It is a simple GET request so I don't really know why is the body parameter expected during the API operation.
I tried editing it through the Swagger docs as well, but every time it is returning the same error. Can someone guide me as to what is the exact issue and how can I resolve it?

How to work in Laravel app with external api?

in my Laravel 5.7/mysql app I need to make external api to read some data from external
app with get request and to write some data to my db with post request.
Which tools/scripts are there for this and how to make these requests safe?
MODIFIED :
Thanks for feedbacks, but looks like I badly put my question
The external app(I do not know what is it written with) need to read data from my app
and write data to my Laravel 5 app.
And how have I to test these requests while on development locally ?
Looks like I have to use Guzzle as in provided link?
Which steps have I to take for safety on my side?
Thanks!
These three libraries are popular for your use-case:
Guzzle
Curl
zttp
If the database is local you can use Eloquent, If not, remote connection to that database may help. otherwise, if you only have API access you should consume eighter of above libraries or any alternative options to make an HTTP request your application might require.
Security-wise, as long as you are only making a request to a remote server, the Suggested way is to store any key or secret string related to authorizing your request (if applicable) in your .env to prevent it from committed to your version control systems. Needless to say to always handle any possible HTTP error your remote API might throw in order to prevent any unwanted error on your application side.
And as Abir Adak mentioned in the comment check this thread for further details.
Updated Answer: On the case of MODIFIED part, generally you have 3 popular options,
REST API
This blog post is a detailed walkthrough written for Laravel
This one from Stack Overflow can help you with designing you API
This last one can help you to develop a widely accepted API response and endpoints by following its specifications.
GraphQL
Can save some time for developing your API, but I suggest to make sure that the consumers of your API are happy to use this option.
GraphQ
Laravel Package for GraphQL
If using Laravel isn't a must, and you are using PostgreSQL, you might want to look at Hasura as well.
SOAP
Have little knowledge on this option for Laravel, just know folks coding using C# and .net are happier to expose their API with this protocol. read more about it on WikiPedia
Postman is a great tool for testing your API or any other API.

LUIS REST api returns 400 - Resource not found

I've an app on LUIS which was working fine until I made few changes to the entities list. I published my app after the changes and LUIS returns 400 state. My other apps using same subscription key from Azure work fine. I tried creating a new app with the same data and the new app also returns 400.
The test panel inside the app also does not work. Any suggestions ?
Although I don't have any proposed solution, I rebuilt the list entity which was causing the error. Looks like the issue is due to some encoding while converting from excel to json. If anyone comes across a similar scenario, I would suggest to check your entities first.

Advantages of using APIs wrapped with .NET in Xamarin

Around a year ago I made an iOS application that finds restaurants near your location of any type and displays information about them. I made a web service call using the FourSquare api to get all the data which was returned in json format and then I parsed it and displayed the information on the UI of the app. Now I want to make an android application using Xamarin.Android since I am learning working with Xamarin studios and C#. When I make a Xamarin.Android application and go to packages then add packages I see there is a Foursquare api package that has a .NET wrapper around it. Here is the website url:
https://www.nuget.org/packages/Foursquare.Api/
So my question is how does this work? Does adding this package mean I don't have to make a web serivce call anymore, instead all the data is stored inside this package and I just have to get all the data the same way I get information from a local database? What are the advantages of using this package instead of just making a web service call to Foursquare?
Think of it this way:
This Foursquare API is simply a .NET wrapper of the web service that you want to use. Thus, somebody has gone ahead and done all of the hard work for you so you can simply consume the returned data in your applications.
What does this mean for you?
Well it means that you don't have to write any REST consumption code and you can focus more on the actual application and any business logic that you need to implement based on the Foursquare objects.
To not confuse any further, this data would come the same way as if you wrote your own web service to access the data from the Foursquare API endpoint.
Advantages:
Already written for you
You don't need to know your way around their REST API
Usually follows best practices per language so it's easy to consume (Objects created, methods, etc)
Disadvantages:
REST endpoint might be updated and not reflect in the package until it's updated
Any bugs/issues in the framework can be hard to workaround if the project is not open source
Could be a lack of documentation on how to use the wrapper

Syncing with an External API in Volt Ruby Framework

I'm looking into Volt as an option for building an Admin interface to our REST API. The API is a separate application. I would like the Admin application to persist data to the API but also store it's own data that is irrelevant to the API (such as admin users and notes on the API data objects) locally.
Is there a way to sync each local change in the Admin with our remote API, like a callback, for example? Or do I need to wait until the Data Provider API is ready as mentioned in the most recent Volt blog post (as of writing)?
So this is a fairly common thing, so I think long term the solution will be to support multiple stores in an app and have a REST data provider that you can extend. However that might be a while before that's ready. In the mean time, you can always load and save data via tasks. (I realize its not ideal, but it will work right now) Let me know if you need more info on using tasks to load and save. I'll add the REST data provider to the TODO list.

Resources