federation-hotchocolate icon indicating copy to clipboard operation
federation-hotchocolate copied to clipboard

feat: full support for `@link` directive

Open dariuszkuc opened this issue 9 months ago • 0 comments

Currently we don't support all features of @link directive.

directive @link(
    url: String!,
    as: String,
    import: [Import],
    for: Purpose)
repeatable on SCHEMA

scalar Import

enum Purpose {
  SECURITY
  EXECUTION
}

Using @link directive we can "import" other definitions into our current schema. If we don't explicitly import them, those types should be namespaced (prefixed with __ which defaults to spec name). Currently we explicitly import ALL federation directives regardless whether they are used within the schema or not. Similarly when importing elements, users can specify custom names within the local schema, e.g. import @key to become @myKey.

We should support following features

  • [ ] ability to specify list of imported elements
  • [ ] namespace unimported spec elements
  • [ ] ability to provide custom namespace (should default to spec name)
  • [ ] ability to rename imported elements

dariuszkuc avatar Oct 18 '23 22:10 dariuszkuc