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

federation support: generation of documents extend types #166

Open
ravisastryk opened this issue May 4, 2020 · 2 comments
Open

federation support: generation of documents extend types #166

ravisastryk opened this issue May 4, 2020 · 2 comments

Comments

@ravisastryk
Copy link

It would be good to generate documentation with schemas that has federation support.
Reference https://www.apollographql.com/docs/apollo-server/federation/introduction/

For example, the following federated query fails to generate document

extend type Query {
  me: User
}

type User @key(fields: "id") {
  id: ID!
  username: String!
}

error message:

Must provide schema definition with query type or a type named Query
@treble-snake
Copy link

@ravisastryk Not sure if it helps, but in case of using federation, it would make sense to generate docs based on Gateway introspection (not downstream services) or on a JSON file produced by apollo client:download-schema command. I don't know your use case ofc, but worked for me.

@bsmedberg-xometry
Copy link

There are two cases here:

  1. I want to document the entire federated schema. I think this is possible today by taking your federated schemas, putting them together using the composeAndValidate function from @apollo/federation, and then running graphdoc on the resulting schema.... I'm having some trouble with composeAndValidate dropping docstrings, so the resulting documentation is less than helpful.

  2. I want to document each service that makes up a federated service separately. I'm still trying to figure out how to do this, and it may involve additional direct support from graphdoc, because in this case you're intentionally wanting to parse and document an "incomplete" schema with @extends directives for types that don't exist. It isn't just for Query and Mutation, but any other extended types.

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

3 participants