You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How could we go about integrating middleware? I have a lot of endpoints, and most of them are protected by requiring a Bearer (which is added to the Context).
I am looking for a way to check if this bearer is present, and if not, throw some GraphQL error. But I'd prefer not to repeat this logic across all queries/mutations.
Instead it would be preferable to do some check once, e.g.
if(query.mutation.name !== 'authenticate') {
// ensure bearer is present, or throw unauthorized error
}
The text was updated successfully, but these errors were encountered:
How could we go about integrating middleware? I have a lot of endpoints, and most of them are protected by requiring a Bearer (which is added to the Context).
I am looking for a way to check if this bearer is present, and if not, throw some GraphQL error. But I'd prefer not to repeat this logic across all queries/mutations.
Instead it would be preferable to do some check once, e.g.
The text was updated successfully, but these errors were encountered: