# 🏗️GraphQL API

This GraphQL schema defines the types and operations available in the API.

## Types

### Circle Type

Represents a circle.

### ProofRecord Type

Represents a proof record.

### CircleStats Type

Represents statistics for a circle.

### SystemStats Type

Represents system-wide statistics.

### Query Type

The root query type.

### Mutation Type

The root mutation type.

Note: The exclamation mark (!) after a type indicates that the field is non-nullable.

## Queries

### stats

Retrieves system-wide statistics.

**Returns:**An object of type

`SystemStats`

containing the following fields:`totalCircles`

: An integer representing the total number of circles.`totalProofs`

: An integer representing the total number of proofs.`totalMembers`

: An integer representing the total number of members.

### circles

Retrieves all circles.

**Returns:**An array of

`Circle`

objects representing all the circles.

### circlesByType

Retrieves circles by type.

**Arguments:**`circleType`

(required): A string representing the type of circles to retrieve.

**Returns:**An array of

`Circle`

objects representing the circles of the specified type.

### circle

Retrieves a circle by ID.

**Arguments:**`id`

(required): The ID of the circle to retrieve.

**Returns:**A

`Circle`

object representing the retrieved circle.

## Mutations

### createCircle

Creates a new circle.

**Arguments:**`circleId`

(required): The ID of the circle.`name`

(required): The name of the circle.`displayName`

: The display name of the circle.`tooltip`

: The tooltip text for the circle.`image`

: The image URL for the circle.`description`

: The description of the circle.`coordinator`

(required): The coordinator of the circle.`members`

: An array of member IDs associated with the circle.`circleType`

: The type of the circle.`circleMetadata`

: Additional metadata for the circle.`signature`

: The signature for creating the circle.

**Returns:**A string representing the created circle.

### addIdentityToCircle

Adds an identity to the specified circle.

**Arguments:**`circleId`

(required): The ID of the circle.`identityCommitment`

(required): The identity commitment to be added.

**Returns:**A

`Circle`

object representing the circle with the added identity.

### revokeIdentityFromCircle

Revokes an identity from the specified circle.

**Arguments:**`circleId`

(required): The ID of the circle.`identityCommitment`

(required): The identity commitment to be revoked.

**Returns:**A

`Circle`

object representing the circle with the revoked identity.

### broadcastSignal

Broadcasts a signal and its associated proof.

**Arguments:**`circleId`

(required): The ID of the circle.`signal`

(required): The signal to be broadcasted.`nullifierHash`

(required): The nullifier hash associated with the signal.`externalNullifier`

(required): The external nullifier associated with the signal.`solidityProof`

: An array of strings representing the solidity proof.

**Returns:**A string representing the result of the broadcast.

### broadcastTestSignal

Broadcasts a test signal with the specified seed.

**Arguments:**`circleId`

(required): The ID of the circle.`signal`

(required): The signal to be broadcasted.`seed`

(required): The seed for generating the test signal.

**Returns:**A string representing the result of the broadcast.

### broadcastPost

Broadcasts a post within the specified circle.

**Arguments:**`circleId`

(required): The ID of the circle.`profileId`

(required): The profile ID associated with the post.`contentURI`

(required): The content URI of the post.`refInitData`

(required): The reference initialization data for the post.`signature`

: The signature for creating the post.

**Returns:**A string representing the result of the broadcast.

### broadcastComment

Broadcasts a comment within the specified circle.

**Arguments:**`circleId`

(required): The ID of the circle.`profileId`

(required): The profile ID associated with the comment.`pointedPost`

(required): The ID of the post being commented on.`contentURI`

: The content URI of the comment.`refInitData`

(required): The reference initialization data for the comment.`refData`

(required): The reference data for the comment.`signature`

: The signature for creating the comment.

**Returns:**A string representing the result of the broadcast.

### createBalanceOfProof

Creates a balance of proof.

**Arguments:**`identityCommitment`

(required): The identity commitment for the balance of proof.`ethAddress`

(required): The Ethereum address associated with the balance of proof.`balance`

(required): The balance value.`linkedEOASig`

: The signature of the linked Ethereum address.`secondaryEOASig`

: The signature of the secondary Ethereum address.`secondaryEOAAddress`

: The secondary Ethereum address.

**Returns:**A string representing the created balance of proof.

### createProofOfLens

Creates a proof of lens.

**Arguments:**`identityCommitment`

(required): The identity commitment for the proof of lens.`ethAddress`

(required): The Ethereum address associated with the proof of lens.`lensId`

(required): The ID of the lens.`linkedEOASig`

: The signature of the linked Ethereum address.`secondaryEOASig`

: The signature of the secondary Ethereum address.`secondaryEOAAddress`

: The secondary Ethereum address.

**Returns:**A string representing the created proof of lens.

### createProofOfNFT

Creates a proof of NFT.

**Arguments:**`identityCommitment`

(required): The identity commitment for the proof of NFT.`ethAddress`

(required): The Ethereum address associated with the proof of NFT.`nftAddress`

(required): The address of the NFT contract.`linkedEOASig`

: The signature of the linked Ethereum address.`secondaryEOASig`

: The signature of the secondary Ethereum address.`secondaryEOAAddress`

: The secondary Ethereum address.

**Returns:**A string representing the created proof of NFT.

### createGithubRepoOwnerProof

Creates a proof of Github repo ownership.

**Arguments:**`identityCommitment`

(required): The identity commitment for the Github repo ownership proof.`repoName`

(required): The name of the repository.`signature`

: The signature for creating the Github repo owner proof.

**Returns:**A string representing the created Github repo owner proof.

### createProofOfTwitter

Creates a proof of Twitter account ownership.

**Arguments:**`identityCommitment`

(required): The identity commitment for the Twitter account ownership proof.`ethAddress`

(required): The Ethereum address associated with the proof.`twitterHandle`

(required): The Twitter handle.`signature`

: The signature for creating the Twitter account ownership proof.

**Returns:**A string representing the created Twitter account ownership proof.

Last updated