How to execute Graphql Schema on Laravel Api Controller? - laravel

I want to create a Rest API with Laravel, and on API controller i want to execute a particular Graphql schema, for example:
When I call this API
http://127.0.0.1:8000/flight
I want that the API to execute this schema: query{flight{flightNumber}}
ps: I want them both to execute in the same project.

Related

How make graphql apollo query request inside controller, but not component?

How make graphql apollo query request inside controller, but not component?
In RTK query we can just use something like initiate for example, but what about apollo?
Can we make request outside component somewhere on controller?
You can use client.query() to run a query outside of a React component. [docs]

How to test an Appsync in Insomnia for IAM authenticated Query

I have an Appsnyc query which I would like to test via clients like Insomnia or Postman as I want to check what header parameters work when trying to access the appsync via client side code
The Appsync query has IAM authentication.
In header parameter, what should be given to execute the query. I understand ACCESS_KEY; SECRET_KEY and SESSION_KEY should be given but not sure about exact parameter key name?
Can you please help on this? Searched lot of documents but execution only using API KEY is given mostly.
For example: to test API KEY secured appsync, one has to give something like "x-api-key" under header parameter.
What works correctly for IAM secured query?

How we can create a webservice with authentication in Laravel?

I want to create webservices in laravel with authentication check for accessing the different endpoints and option to create application for the webservice usage like generating API key, secret etc.
Laravel Passport is where you can look at.
https://laravel.com/docs/5.4/passport

Laravel5.4 authenticate users from api source, i.e. without database table for user/admin

Laravel5.4 authenticate users from api source, i.e. without database table for user/admin. I expected JSON response from Api, after success how to use the Auth class so that I can maintain the sessions and authentication just like database. Do I have to make custom auth? If so how will I initiate attempt method as it checks for database. I have made admin guard, Is there any way to accomplish this. Thank you.

ASP.NET MVC request forwarder

I would like to achieve this kind of functionality:
When a client makes GET request to
GET http://www.myserviceurl.com/rest/facebook/profile/me
to get response from
GET http://graph.facebook.com/profile/me
Application logic will append all nessesary parameters so the final url will look like:
graph.facebook.com/profile/me?access_token=XXX
Similar,
POST myserviceurl.com/rest/twitter/statuses/update.json
with post data
status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk&trim_user=true&include_entities=true
->
POST api.twitter.com/1/statuses/update.json
with POST data
status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk&trim_user=true&include_entities=true
This way I want to create a layer of apstraction and allow my clients to invoke my rest service using the same structure of provider rest url.
What will be a recommended approach?
Maybe You could use Facebook C# SDK (which is basically a wrapper for Facebook Graph API) to fetch json data from Facebook and return it to Your users.

Resources