graphql-services / graphql-gateway

Apollo federation gateway wrapped in Docker image or AWS Lambda package.
MIT License
31 stars 8 forks source link

Please advise the best way to add a UUID type support #23

Closed ohmycto closed 3 years ago

ohmycto commented 3 years ago

Hi there! First of all, many thanks for your tool!

My GraphQL server implements a custom type UUID and gateway crashes with an error:

Error: Unknown type: "UUID".

I'm not really good at NodeJS, so could you please advise the best way to implement it? I found https://github.com/Urigo/graphql-scalars which I believe should add a support for UUID to resolvers, but don't understand, how to plug it in.

Thank you.

jakubknejzlik commented 3 years ago

Hi @ohmycto, would You ming sharing the schema or any reproducible example? We are using custom scalars as well in underlying services and never hit any issues (as it's basically .

If I'm not mistaken following types are the default ones: String, Int, Float, Boolean and ID

I'm currently looking at one of our schemas and for example (the Time is custom scalar type used by gqlgen):

scalar Time
...

type WorkLog {
  id: ID!
...
  updatedAt: Time
  createdAt: Time!
}

...maybe Your schema is missing the scalar UUID line? (just guessing)

ohmycto commented 3 years ago

@jakubknejzlik You saved my day!

maybe Your schema is missing the scalar UUID line? (just guessing)

This was exactly the point a was looking for! Thank you very much!