Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions docs/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GraphQL queries and mutations are now organized under `group → version → res

- Core group examples:
- Before: `core { ConfigMaps { ... } }`
- Now: `core { v1 { ConfigMaps { ... } } }`
- Now: `v1 { ConfigMaps { ... } }`

- Non-core groups (dots replaced by underscores):
- Before: `openmfp_org { Accounts { ... } }`
Expand All @@ -18,36 +18,34 @@ Plural list fields now return a wrapper object with pagination metadata:

```graphql
query {
core {
v1 {
ConfigMaps {
resourceVersion
continue
remainingItemCount
items { metadata { name namespace resourceVersion } }
}
v1 {
ConfigMaps {
resourceVersion
continue
remainingItemCount
items { metadata { name namespace resourceVersion } }
}
}
}
```

## Subscriptions: flat and versioned field names

Subscriptions remain flat but now include the version in the field name: `<group>_<version>_<resource>`.
Subscriptions remain flat and versioned. Core resources no longer include the artificial `core` group in the flattened name.

- Core examples: `core_v1_configmaps`, `core_v1_configmap`
- Core examples: `v1_configmaps`, `v1_configmap`
- Non-core examples: `openmfp_org_v1alpha1_accounts`, `openmfp_org_v1alpha1_account`

Subscriptions use Server‑Sent Events (SSE). GraphiQL/Playground typically do not support SSE subscriptions. Use curl/Postman/Insomnia or a custom EventSource client.

Example:
Example (core):

```sh
curl \
-H "Accept: text/event-stream" \
-H "Content-Type: application/json" \
-d '{
"query": "subscription { core_v1_configmaps { type object { metadata { name namespace resourceVersion } } } }"
"query": "subscription { v1_configmaps { type object { metadata { name namespace resourceVersion } } } }"
}' \
$GRAPHQL_URL
```
Expand All @@ -58,6 +56,7 @@ To start from a known list `resourceVersion`, fetch it via a list query and pass

- Legacy flat query/mutation names have been removed.
- Old unversioned subscription names have been removed.
- Core flattened subscription names changed from `core_v1_*` to `v1_*`.

Please update your client queries accordingly. See detailed examples:

Expand Down
102 changes: 46 additions & 56 deletions docs/configmap_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@ For questions on how to execute them, please find our [Quick Start Guide](./quic
## Create a ConfigMap:
```shell
mutation {
core {
v1 {
createConfigMap(
namespace: "default",
object: {
metadata: {
name: "example-config"
},
data: { key: "val" }
}
) {
metadata {
name
}
data
v1 {
createConfigMap(
namespace: "default",
object: {
metadata: {
name: "example-config"
},
data: { key: "val" }
}
) {
metadata {
name
}
data
}
}
}
Expand All @@ -30,20 +28,18 @@ mutation {
## List ConfigMaps:
```shell
query {
core {
v1 {
ConfigMaps {
resourceVersion
continue
remainingItemCount
items {
metadata {
name
namespace
resourceVersion
}
data
v1 {
ConfigMaps {
resourceVersion
continue
remainingItemCount
items {
metadata {
name
namespace
resourceVersion
}
data
}
}
}
Expand All @@ -53,14 +49,12 @@ query {
## Get a ConfigMap:
```shell
{
core {
v1 {
ConfigMap(name: "example-config", namespace: "default") {
metadata {
name
}
data
v1 {
ConfigMap(name: "example-config", namespace: "default") {
metadata {
name
}
data
}
}
}
Expand All @@ -69,21 +63,19 @@ query {
## Update a ConfigMap:
```shell
mutation {
core {
v1 {
updateConfigMap(
name:"example-config"
namespace: "default",
object: {
data: { key: "new-value" }
}
) {
metadata {
name
namespace
}
data
v1 {
updateConfigMap(
name:"example-config"
namespace: "default",
object: {
data: { key: "new-value" }
}
) {
metadata {
name
namespace
}
data
}
}
}
Expand All @@ -92,13 +84,11 @@ mutation {
## Delete a ConfigMap:
```shell
mutation {
core {
v1 {
deleteConfigMap(
name: "example-config",
namespace: "default"
)
}
v1 {
deleteConfigMap(
name: "example-config",
namespace: "default"
)
}
}
```
112 changes: 53 additions & 59 deletions docs/pod_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,49 @@ For questions on how to execute them, please find our [Quick Start Guide](./quic
## Create a Pod:
```shell
mutation {
core {
v1 {
createPod(
namespace: "default",
object: {
metadata: {
name: "my-new-pod",
labels: {
app: "my-app"
}
}
spec: {
containers: [
{
name: "nginx-container"
image: "nginx:latest"
ports: [
{
containerPort: 80
}
]
}
]
restartPolicy: "Always"
v1 {
createPod(
namespace: "default",
object: {
metadata: {
name: "my-new-pod",
labels: {
app: "my-app"
}
}
) {
metadata {
name
namespace
labels
}
spec {
containers {
name
image
ports {
containerPort
spec: {
containers: [
{
name: "nginx-container"
image: "nginx:latest"
ports: [
{
containerPort: 80
}
]
}
}
restartPolicy
]
restartPolicy: "Always"
}
status {
phase
}
) {
metadata {
name
namespace
labels
}
spec {
containers {
name
image
ports {
containerPort
}
}
restartPolicy
}
status {
phase
}
}
}
Expand All @@ -60,18 +58,16 @@ mutation {
## Get the Created Pod:
```shell
query {
core {
v1 {
Pod(name:"my-new-pod", namespace:"default") {
metadata {
name
}
spec{
containers {
image
ports {
containerPort
}
v1 {
Pod(name:"my-new-pod", namespace:"default") {
metadata {
name
}
spec{
containers {
image
ports {
containerPort
}
}
}
Expand All @@ -83,13 +79,11 @@ query {
## Delete the Created Pod:
```shell
mutation {
core {
v1 {
deletePod(
namespace: "default",
name: "my-new-pod"
)
}
v1 {
deletePod(
namespace: "default",
name: "my-new-pod"
)
}
}
```
40 changes: 19 additions & 21 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,30 +74,28 @@ Kubernetes extensively uses dotted keys (e.g., `app.kubernetes.io/name`) in labe
**Quick Example:**
```shell
mutation createPodWithLabels($labels: StringMapInput) {
core {
v1 {
createPod(
namespace: "default"
object: {
metadata: {
name: "my-pod"
labels: $labels
}
spec: {
containers: [
{
name: "nginx"
image: "nginx:latest"
ports: [{ containerPort: 80 }]
}
]
}
v1 {
createPod(
namespace: "default"
object: {
metadata: {
name: "my-pod"
labels: $labels
}
) {
metadata {
labels # Returns: {"app.kubernetes.io/name": "my-app"}
spec: {
containers: [
{
name: "nginx"
image: "nginx:latest"
ports: [{ containerPort: 80 }]
}
]
}
}
) {
metadata {
labels # Returns: {"app.kubernetes.io/name": "my-app"}
}
}
}
}
Expand Down
Loading
Loading