Skip to content

Is there a supported way to distinguish between authenticated and unauthenticated operations? #3577

@nobody-nn

Description

@nobody-nn

Question

Hi Apollo iOS team 👋

In our project, we're trying to distinguish between authenticated and unauthenticated GraphQL operations, so that our ApolloInterceptor only adds authentication headers for the relevant requests.

Currently, we're going to use a custom script to scan the generated operations and maintain a list of unauthenticated operations, but we were wondering:

  1. Does Apollo iOS support any built-in way or pattern to mark or identify unauthenticated operations?
  2. If not, would it make sense to use a custom directive or metadata in the schema that the codegen could potentially expose?

Would appreciate any guidance or best practices around this.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues that have a question which should be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions