Skip to main content

Access to Graphql from code

GraphQL Endpoint

Finmars exposes GraphQL via a single endpoint.

:realm_code:/:space_code:/graphql/

This endpoint supports:

  • Queries
  • Mutations
  • Schema introspection

How to Access the Endpoint

Authentication

GraphQL uses the same authentication as the REST API.

Usually:

  • Keycloak Auth Token (web)
  • Authorization header (JWT tokens)


"DEFAULT_AUTHENTICATION_CLASSES": (   
   "poms.common.authentication.JWTAuthentication",    
   "poms.common.authentication.KeycloakAuthentication",
),


If you are not authenticated:

  • Requests will fail
  • Data will not be returned

From Code

Send a POST request to /graphql/.

Content type:

application/json

Body example:

Headers must include authentication.