Apollo-server: @Provides Directive Unexpected Error

Created on 4 Jun 2019  ·  6Comments  ·  Source: apollographql/apollo-server

Reproduction Repo: https://github.com/ksaldana1/provides-fed-repro

I am pretty confused by what I am seeing here. I followed the example from the docs, and from what I can tell the structure I have isn't any different from the example provided in the federation-demo, but maybe I'm missing something really obvious.

Despite me labeling my fields, I'm still getting error messages such as :
UnhandledPromiseRejectionWarning: GraphQLSchemaValidationError: [users] Kitchen.name -> is marked as @external but is not used by a @requires, @key, or @provides directive.

This was happening on a larger project and seemed to continue when I scaled it down.

Thanks for all your hard work! Federation is really awesome!

👩‍🚀 federation

Most helpful comment

Thanks for getting this fixed @JakeDawkins ! The first time I read through the federation docs I thought "I don't think I'll need these advanced features...", but then after I grokked them it felt hard to live without. So thanks for being one step ahead on the features!

All 6 comments

@ksaldana1 this does indeed seem like a bug! @JakeDawkins can you take a look?

I'm on it!

@JakeDawkins, any update on this? I seem to be having a similar issue:

extend type TruckType @key(fields: "id"){
    id: ID! @external
}

throws the following error:
```
Exception: GraphQLSchemaValidationError: [inquiries] TruckType.id -> is marked as @external but is not used by a @requires, @key, or @provides directive
````

Thanks for the hard work!

Hey @JannesV! Sorry for the slow response. I have a WIP PR open for the issue now. I have a couple more cases to fix, especially around @requires, but I'm trying to wrap it up quickly!

Thanks! I've just found out my error was due to my own ignorance. I forgot to specify the @key directive on the type I'm extending. When including that it resolved my issue.

Thanks for getting this fixed @JakeDawkins ! The first time I read through the federation docs I thought "I don't think I'll need these advanced features...", but then after I grokked them it felt hard to live without. So thanks for being one step ahead on the features!

Was this page helpful?
0 / 5 - 0 ratings