Skip to main content

Module Services

Less than 1 minuteModuleserviceshttpapi

Get context

import { generateEndpoint } from '@equinor/fusion-framework-module-services/get';
const url = generateEndpoint('v1', 'guid-of-an-project');

Query Context

Query the context service for context items

Parameters

The query parameter can be either a string or a object, which will decode to OData query string.

When providing a string, the string must be in a special OData format, use tools like odata-queryopen in new window to build the string

OData

not all functionalities are supported from the service, we advice to provide an object, which the framework generates the query string

type QueryContextODataFilter = {
    type?: string[];
    externalId?: string;
};

type QueryContextODataParameters = {
    search?: string;
    filter?: {
      type?: string[];
      externalId?: string;
    }
};

Example

Basic
import { generateEndpoint } from '@equinor/fusion-framework-module-services/query';
const url = generateEndpoint('v1', {
  query: {
    search: 'johan',
    filter: {
      type: ['ProjectMaster'],
    }
  }
});