Skip to content

General question about the Apollo Federation Transform #4508

Closed
@bwoody3142

Description

@bwoody3142

I was under the impression that the federation transform actually added apollo federation directives to a type, so if this was my .meshrc.yml for the openapi-stackexchange example:

sources:
  - name: StackExchange
    handler:
      openapi:
        source: https://raw.githubusercontent.com/grokify/api-specs/master/stackexchange/stackexchange-api-v2.2_openapi-v3.0.yaml
    transforms:
      - federation:
          types:
            - name: Question
              config:
                keyFields:
                  - question_id


documents:
  - list-questions.query.graphql

serve:
  customServerHandler: index

With my assumptions on how this work I was assuming that this would transform the Question type from this:

type Question {
  tags: [String]
  owner: QuestionOwner
  is_answered: Boolean
  view_count: Int
  answer_count: Int
  score: Int
  last_activity_date: Int
  creation_date: Int
  question_id: Int
  link: String
  title: String
}

into this:

type Question @key (fields: "question_id") {
  tags: [String]
  owner: QuestionOwner
  is_answered: Boolean
  view_count: Int
  answer_count: Int
  score: Int
  last_activity_date: Int
  creation_date: Int
  question_id: Int
  link: String
  title: String
}

Is this how it is supposed to work, if not what am I missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions