bramble icon indicating copy to clipboard operation
bramble copied to clipboard

should bramble complain about built-in directives declared in spec?

Open benzolium opened this issue 2 years ago • 3 comments

I've recently encountered a bug when was trying to federate a service which contained specifiedBy directive. It is in latest gql spec, but i've got an error:

Undefined directive specifiedBy.

Should I declare such directives in downstream services? Or it is a bug?

benzolium avatar Aug 30 '22 13:08 benzolium

Hi @benzolium we're using the graphql-go library to parse GraphQL. I did a quick search of the library and can't find any support for the directive yet. We're at v1.3.0 but it looks like the v1.4.0 release also doesn't include it either.

As a quick fix you could declare the directive in your services, but is a bug that we're not supporting the new builtin directive.

pkqk avatar Aug 30 '22 22:08 pkqk

@pkqk thanks for the reply! I've opened an issue there.

Also thanks for a quick fix idea - I've just done that exact thing. 🙂

benzolium avatar Aug 31 '22 07:08 benzolium

@benzolium I see you've already got support merged in to the gophers library 💯 , I'll try out the head and we'll update when they release.

pkqk avatar Aug 31 '22 21:08 pkqk

@pkqk the package has been finally released. But actually I can't write a test to reproduce the error. The only thing which was failing was vektah/gqlparser.

It was updated with specifiedby directive long time ago: https://github.com/vektah/gqlparser/releases/tag/v2.3.0. Bramble is on 2.2.0 now so it's also worth updating.

benzolium avatar Dec 27 '22 05:12 benzolium