Skip to content

Testing Authenticated Elements #138

@armstnp

Description

@armstnp

Question

I'm currently trying to set this up, but I'm having difficulty running any form of integration test on the schema itself.

I have a number of tests in a format similar to that specified by the GraphQL-Ruby documentation, but with this gem in operation, all my tests now fail with the claim that the user is not signed in.

I'm executing queries from the schema, not the controller, but the schema and controller are now more tightly coupled since the schema now delegates to the controller for authentication. Is there a recommended means by which a user can be readily specified for a schema call? I've been digging through the gem callchain and I can't seem to figure out how this might be done. I've tried creating a context for the Schema#execute call with a stubbed controller, but that doesn't seem to do the trick.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions