Comments (11)
@HofmannZ Not sure where else to put this, but how would you create a custom Link that would listen for the responses and chain a request if needed? So if I try to make a mutation but my authentication token is expired, how can I check the graphql response for the authentication error, refresh my token, then retry my mutation?
from graphql-flutter.
Fix is in PR #36
from graphql-flutter.
Or something like
Authorization: <type> <credentials>
from graphql-flutter.
@HofmannZ any progress?
from graphql-flutter.
@HofmannZ Looking forward to PR #36 as I too need to have more control over the headers for AWS AppSync.
I am testing out your link-1 branch, is that working for the http-link? I am accessing the GraphQL client outside of a widget.
If so, could you post some basic example code? I have tried to pass in the HttpLink object to the GraphqlClient, but get an error when trying to create the HttpLink object "type 'Link' is not a subtype of type 'HttpLink'" So I suspect I am doing something wrong.
from graphql-flutter.
@vmwsree, @endigo & @jeprojects fixed in #36.
To try it out use version 1.0.0-alpha.3
of this package.
from graphql-flutter.
@HofmannZ I'm trying appsync integration. Did you get that to work? If so, can you post how you passed auth to the client? Thank you.
from graphql-flutter.
how can I add authentication header in graphql-client api??
from graphql-flutter.
@Gitutsav it is actually quite easy and flexible. You could set your own http/Client
implementation into the HttpLink
constructor fetch
parameter.
For our project I implemented bearer authentication with token refreshment in this client. You can intercept all the requests and modify them, add headers, query parameters, all you need.
But if you only need to set headers, just using them directly in the HttpLink
constructor is enough.
from graphql-flutter.
@Gitutsav I think the easiest way would be to use the auth link or create a custom auth link.
@wwwdata I think it would be way easier to create your own link see #173.
from graphql-flutter.
from graphql-flutter.
Related Issues (20)
- [feature] add an easy way to add headers HOT 6
- Issue with Registering Users via GraphQL on Supabase - Need Assistance
- Executing the same query in parallel only makes one request
- New release request to fix upstream bugs HOT 3
- How to return partial data from cache?
- Typo in packages/graphql/lib/src/core/policies.dart
- Update uuid version to ^4.0.0 HOT 4
- Subscription throws uncaught handshake exception when using http HOT 1
- Extreme slowness/jank with JSON scalar
- UUID Out of Date HOT 2
- Example needed for cache HOT 2
- Documentation not clear about uploading file HOT 1
- Connection closed before full header was recieved error HOT 2
- Invalid result data when two list items nearly identical HOT 1
- Graphql Subscription not working HOT 2
- Not able to Mock the Result of Query Widget
- GraphQLDataProxy usage example fails with PartialDataException(path: __typename) HOT 1
- OperationException thrown from a WatchQuery operation
- Make `connectivity
- Make `connectivity_plus` optional.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-flutter.