What is the difference between RedwoodGraphQLContext and GlobalContext?

In the api side, you can get the context either from the:

  1. resolve args (GraphQL | RedwoodJS Docs)
  2. Importing the context: (GraphQL | RedwoodJS Docs)

The context in the resolver args has the RedwoodGraphQLContext typing and the imported one has the GlobalContext type.

The RedwoodGraphQLContext type has the event and requestContext properties while the GlobalContext type only has the currentUser property.

Is there a reason for 2 separate typings? They seem to be the same object

1 Like