Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General question about the Apollo Federation Transform #4508

Closed
bwoody3142 opened this issue Sep 16, 2022 · 1 comment
Closed

General question about the Apollo Federation Transform #4508

bwoody3142 opened this issue Sep 16, 2022 · 1 comment

Comments

@bwoody3142
Copy link

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?

@ardatan
Copy link
Owner

ardatan commented Aug 22, 2023

Hi @bwoody3142 !
We recently did a lot of improvements in Federation transform recently. I think this issue should be fixed as well. Closing this issue for now but we can reopen it if it still persists.

@ardatan ardatan closed this as completed Aug 22, 2023
This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants