orchardcore-graphql
Skill for configuring and using the GraphQL API in Orchard Core. Covers GraphQL queries, custom types, content type querying, and GraphQL schema customization. Use this skill when requests mention Orchard Core GraphQL, Configure and Use GraphQL API, Enabling GraphQL Features, Basic Content Query, Query with Filtering, Query with Pagination, or closely related Orchard Core implementation, setup, extension, or troubleshooting work. Strong matches include work with OrchardCore.Apis.GraphQL, OrchardCore.ContentManagement, OrchardCore.Apis, MyPart, MyField, MyPartIndexAliasProvider, IIndexAliasProvider, MyPartIndex, IEnumerable, IServiceCollection, WhereInput. It also helps with graphql examples, Query with Filtering, Query with Pagination, Query Specific Content Item, plus the code patterns, admin flows, recipe steps, and referenced examples captured in this skill.
Works with
---
name: orchardcore-graphql
description: Skill for configuring and using the GraphQL API in Orchard Core. Covers GraphQL queries, custom types, content type querying, and GraphQL schema customization. Use this skill when requests mention Orchard Core GraphQL, Configure and Use GraphQL API, Enabling GraphQL Features, Basic Content Query, Query with Filtering, Query with Pagination, or closely related Orchard Core implementation, setup, extension, or troubleshooting work. Strong matches include work with OrchardCore.Apis.GraphQL, OrchardCore.ContentManagement, OrchardCore.Apis, MyPart, MyField, MyPartIndexAliasProvider, IIndexAliasProvider, MyPartIndex, IEnumerable, IServiceCollection, WhereInput. It also helps with graphql examples, Query with Filtering, Query with Pagination, Query Specific Content Item, plus the code patterns, admin flows, recipe steps, and referenced examples captured in this skill.
license: Apache-2.0
---
# Orchard Core GraphQL - Prompt Templates
## Configure and Use GraphQL API
You are an Orchard Core expert. Generate GraphQL queries and custom type definitions for Orchard Core.
### Guidelines
- Enable `OrchardCore.Apis.GraphQL` to expose a GraphQL endpoint at `/api/graphql`.
- Content types are automatically exposed as GraphQL types.
- Use the GraphiQL interface at `/admin/graphql` for query exploration.
- Custom GraphQL types can extend the schema for custom data.
- GraphQL queries support filtering, sorting, and pagination.
- Authentication and authorization apply to GraphQL queries.
- Use `WhereInput` types for filtering content items.
### Enabling GraphQL Features
```json
{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Apis.GraphQL"
],
"disable": []
}
]
}
```
### Basic Content Query
```graphql
{
blogPost {
contentItemId
displayText
createdUtc
publishedUtc
titlePart {
title
}
autoroutePart {
path
}
htmlBodyPart {
html
}
}
}
```
### Query with Filtering
```graphql
{
blogPost(where: {displayText_contains: "orchard"}) {
contentItemId
displayText
publishedUtc
}
}
```
### Query with Pagination
```graphql
{
blogPost(first: 10, skip: 0, orderBy: {publishedUtc: DESC}) {
contentItemId
displayText
publishedUtc
}
}
```
### Query Specific Content Item
```graphql
{
contentItem(contentItemId: "{{ContentItemId}}") {
contentItemId
contentType
displayText
publishedUtc
... on BlogPost {
titlePart {
title
}
htmlBodyPart {
html
}
}
}
}
```
### Query Content Items by Status
```graphql
{
blogPost(status: PUBLISHED) {
contentItemId
displayText
publishedUtc
}
}
{
blogPost(status: DRAFT) {
contentItemId
displayText
modifiedUtc
}
}
{
blogPost(status: LATEST) {
contentItemId
displayText
latest
published
}
}
```
### Custom GraphQL Object Type
```csharp
using GraphQL.Types;
using OrchardCore.Apis.GraphQL;
using OrchardCore.ContentManagement;
public sealed class MyPartQueryObjectType : ObjectGraphType<MyPart>
{
public MyPartQueryObjectType()
{
Name = "MyPart";
Field(x => x.MyField)
.Description("My custom field.");
Field(x => x.MyNumber)
.Description("A numeric value.");
}
}
```
### Custom GraphQL Input Type
```csharp
using GraphQL.Types;
public sealed class MyPartInputObjectType : InputObjectGraphType<MyPart>
{
public MyPartInputObjectType()
{
Name = "MyPartInput";
Field(x => x.MyField, nullable: true)
.Description("Filter by my custom field.");
}
}
```
### Custom GraphQL Filter
```csharp
using OrchardCore.ContentManagement.GraphQL.Queries;
public sealed class MyPartIndexAliasProvider : IIndexAliasProvider
{
private static readonly IndexAlias[] _aliases = new[]
{
new IndexAlias
{
Alias = "myPart",
Index = nameof(MyPartIndex),
IndexType = typeof(MyPartIndex)
}
};
public IEnumerable<IndexAlias> GetAliases()
{
return _aliases;
}
}
```
### Registering Custom GraphQL Types
```csharp
using OrchardCore.Apis;
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddObjectGraphType<MyPart, MyPartQueryObjectType>();
services.AddInputObjectGraphType<MyPart, MyPartInputObjectType>();
services.AddScoped<IIndexAliasProvider, MyPartIndexAliasProvider>();
}
}
```
### Querying with Liquid and GraphQL
Execute GraphQL queries from Liquid templates:
```liquid
{% graphql query: "{ blogPost(first: 5, orderBy: {publishedUtc: DESC}) { displayText, autoroutePart { path } } }" %}
{% for post in graphql.blogPost %}
<a href="{{ post.autoroutePart.path }}">{{ post.displayText }}</a>
{% endfor %}
```
### Authentication for GraphQL
GraphQL queries respect Orchard Core permissions. For API access:
```bash
# Query with API key
curl -X POST https://example.com/api/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {{token}}" \
-d '{"query": "{ blogPost { displayText } }"}'
```More API Design skills
lark-event
larksuite/cli
Lark/Feishu real-time event listening / subscribing / consuming: stream events as NDJSON via `lark-cli event consume <EventKey>` (covers IM messages/reactions/chat changes, Approval status changes, Task updates, VC meeting started/joined/ended, Minutes generated, Whiteboard updated, etc.). Use for Lark bots, real-time message processing, long-running subscribers, streaming webhook/push handlers. Supports `--max-events` / `--timeout` bounded runs and a stderr ready-marker contract — designed for AI agents running as subprocesses.
lark-contact
larksuite/cli
飞书 / Lark 通讯录:按姓名 / 邮箱解析成 open_id,或按 open_id 反查姓名 / 部门 / 邮箱 / 联系方式 / 个人状态 / 签名,以及按关键词搜索当前用户可见的机器人 / 智能体(agent)。当用户提到一个名字要下一步发消息 / 排日程,或拿到 open_id 想查具体信息时使用。不负责部门树遍历、按部门列员工、组织架构图,这类需求走原生 OpenAPI。
lark-openapi-explorer
larksuite/cli
飞书/Lark 原生 OpenAPI 探索:从官方文档库中挖掘未经 CLI 封装的原生 OpenAPI 接口。当用户的需求无法被现有 lark-* skill 或 lark-cli 已注册命令满足,需要查找并调用原生飞书 OpenAPI 时使用。

