Project API

Last updated 9 months ago

Under the hood there are two API's at work. The Project API and the Management API. The project API allows CRUD operations on your content within a project. After a project is created, a unique api is generated just for the context of that project.

See the Management API docs here.

Project API Shape

The Project API Shape is impossible to define. Each API changes depend on the defined schema models, enumerations and user roles.

Let's take an example of this project's Content Management Interface (CMI).

"Overview of CMI for Content Models"

The generated API for Super Heroes would then allow for nearly any permutation of the following:

Arguments

where

SuperHeroWhereInput

orderBy

SuperHeroOrderByInput

skip

Int

after

String

before

String

first

Int

last

Int

Fields

id

ID!

createdAt

DateTime!

updatedAt

DateTime!

status

Status!

realName

String

secretName

String

Introspected API

The good thing is that GraphQL Supports a built in introspection feature which allows us to explore this API structure from the playground.

Let's inspect our Super Hero model.

Queries

superHeroes(
where: SuperHeroWhereInput
orderBy: SuperHeroOrderByInput
skip: Int
after: String
before: String
first: Int
last: Int
): [SuperHero]!
superHero(
where: SuperHeroWhereUniqueInput!
): SuperHero
superHeroesConnection(
where: SuperHeroWhereInput
orderBy: SuperHeroOrderByInput
skip: Int
after: String
before: String
first: Int
last: Int
): SuperHeroConnection!

Mutations

createSuperHero(
data: SuperHeroCreateInput!
): SuperHero!
updateSuperHero(
data: SuperHeroUpdateInput!where: SuperHeroWhereUniqueInput!
): SuperHero
deleteSuperHero(
where: SuperHeroWhereUniqueInput!
): SuperHero
upsertSuperHero(
where: SuperHeroWhereUniqueInput!
create: SuperHeroCreateInput!
update: SuperHeroUpdateInput!
): SuperHero!
updateManySuperHeroes(
data: SuperHeroUpdateInput!where: SuperHeroWhereInput
): BatchPayload!
deleteManySuperHeroes(
where: SuperHeroWhereInput
): BatchPayload!

For making queries, check out the API documentation.