Subgraph API
The subgraph indexes every Roles Modifier configuration across all indexed chains. Query it through the Zodiac App with an API key. Create one in the Zodiac App under Profile → API keys.
Query
Send GraphQL as a POST to https://app.zodiac.eco/api/v1/subgraph:
curl https://app.zodiac.eco/api/v1/subgraph \
-H "Authorization: Bearer $ZODIAC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"{ rolesModifiers(avatar: \"0x<safe address>\") { chainId address roles { key } } }"}'Pass addresses in lowercase.
Schema
Fetch the schema with a GET to https://app.zodiac.eco/api/v1/subgraph/schema.graphql,
under the same key:
curl https://app.zodiac.eco/api/v1/subgraph/schema.graphql \
-H "Authorization: Bearer $ZODIAC_API_KEY"Point code generators at it, for example in a codegen.ts for GraphQL Code Generator:
schema: {
'https://app.zodiac.eco/api/v1/subgraph/schema.graphql': {
headers: { Authorization: `Bearer ${process.env.ZODIAC_API_KEY}` },
},
},Last updated on