2026-03-25 11:46:39 +01:00

62 lines
2.0 KiB
YAML

# yaml-language-server: $schema=https://raw.githubusercontent.com/wundergraph/cosmo/main/router/pkg/config/config.schema.json
version: "1"
subgraphs:
- name: users
routing_url: http://subgraph-python:8000/graphql
schema:
file: ./subgraphs/users/users-schema.graphql
# introspection:
# url: http://localhost:8000/graphql
- name: nats_events
routing_url: http://nats-virtual # The router handles this via EDFS
schema:
file: ./subgraphs/users/schema.graphqls
# Use the "custom_schema" key instead of "custom_queries"
# to ensure the base Mutation type is initialized correctly.
# custom_schema: |
# schema {
# query: Query
# mutation: Mutation
# }
# type Mutation {
# createUser(id: ID!, username: String!, email: String!): edfs__PublishResult!
# @edfs__natsPublish(subject: "user.created", providerId: "my-nats")
# }
# Use the 'override_config' key to force the Mutation into the final schema
# Use custom_queries to 'extend' the Mutation type provided by your Python app
# custom_queries: |
# extend type Mutation {
# createUser(id: ID!, username: String!, email: String!): edfs__PublishResult!
# @edfs__natsPublish(subject: "user.created", providerId: "my-nats")
# }
# This 'extends' the Mutation type you just created in app.py
# custom_queries: |
# extend type Mutation {
# createUser(id: ID!, username: String!, email: String!): edfs__PublishResult!
# @edfs__natsPublish(subject: "user.created", providerId: "my-nats")
# }
# This "unlocks" the Mutation type in the router
# custom_schema: |
# type Mutation
# This tells the COMPOSER (wgc) how to build the router.json
# edfs:
# nats:
# - id: "my-nats"
# url: "nats://nats:4222"
# publish:
# - name: "createUser"
# subject: "user.created"
# providerId: "my-nats"
# arguments:
# - name: "id"
# type: "ID!"
# - name: "username"
# type: "String!"
# - name: "email"
# type: "String!"