ember-data how to customize the http verb - ember-data

I'm using ember-data 2.2.1 in my project;
I need it to use 'PUT' http verb instead of 'PATCH' for updates, since my api requires it;
how is it possible to do that?

Related

Amplify iOS Auth with custom http header

I'm trying to add Amplify Authentication to my iOS project but I'm strugling to find hot to setup a custom http header for my signin request.
I was looking for some way to do something similar to: request.addValue("hello", forHTTPHeaderField: "x-myheader") .
The current API does not seem to support this option through the simple Amplify.Auth.signIn(...) method.
Is there a way to configure this somehow?

fluentd bigquery plugin with Navigator.sendBeacon

I have the fluentd plugin for Bigquery setup and it's been working really great when I use HTTP POST/GET to send JSON payload, but I wanted to try and switch to using Navigator.sendBeacon
The problem is that this API doesn't let me configure the type of payload and these are the ones supported:
A ArrayBuffer, ArrayBufferView, Blob, DOMString, FormData, or
URLSearchParams object containing the data to send.
So when using it as is it the plugin doesn't accept the request.
Is there any way to either explicitly state the payload is JSON or configure/alter the plugin to support the types mentioned above ?
Thanks!

If graphQL uses an async concept and has http capability why does it conflict with the REST API design of Node/Express with http?

I've set up a TypeScript/Node/Express API that includes 'http' for REST and 'express-graphql'. After coding the schema, resolvers and types for TypeScript conformity I run with nodemon ts-node and everything is fine with 'http' requests. When I send a graphQL Query via Postman as a POST it just hangs. I've never seen anything like this that does not time out and it could be running for minutes. Postman shows some unusual 'read RECONNECT' error. Why is graphQL this problematic. Why doesn't it just fit in instead of suggesting the replacement of a perfectly proven process like REST?

Python Graphene. Authorization error handling

I have the following environment:
Frontend
#vue/cli 4.1.2
vue-apollo 3.0.2
Backend
python 3.8
django 3.0.2
graphene-django 2.8.0
django-graphql-jwt 0.3.0
My problem is handle the auth errors when the token has expired. For example, if I request the query me when the token is expired:
def resolve_me(root, info):
user = info.context.user
if user.is_anonymous:
raise GraphQLError('Authentication failure!!')
return user
in the link of the apollo client receive a 200 and the networkError object is empty and graphQLErrors object don't provide the status code.
how you manage this scenario?
Thanks by advance.
Check out this comment https://github.com/graphql-python/graphene/issues/142#issuecomment-221290862
As far as I can tell from the GraphQL spec there is no discussion of http response codes at all. The status codes of HTTP are strongly tied to rest principles. It's not clear to me whether GraphQL APIs should distinguish between 2XX and 4XX status codes.
Most notably, you can batch multiple mutations into the same request to the server. If one successfully creates a resource (201), one mutates a resource (200), one fails validation (400) and another the target object does not exists (404), what should the return value from the API be?
At the moment, GraphQL APIs seem to err on the side of 200 unless the server blows up, in which case 500.

How to use the PATCH method in HTTP adapters?

Can any please help me about how to make HTTP call using the PATCH method in an HTTP Adapter in IBM Worklight?
The PATCH method is not supported. Per the HTTP adapter documentation:
You can use the HTTP adapter to send GET, POST, PUT, and DELETE HTTP
requests and retrieve data from the response body. Data in the
response can arrive in XML, HTML, or JSON formats.
You can submit feature requests via: http://www.ibm.com/developerworks/rfe/