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

add uuid type #2751

Merged
merged 8 commits into from
Sep 8, 2023
Merged

add uuid type #2751

merged 8 commits into from
Sep 8, 2023

Conversation

it512
Copy link
Contributor

@it512 it512 commented Aug 7, 2023

A Universally Unique Identifier (UUID) is a 128-bit used for information in computer systems. The term Globally Unique Identifier (GUID) is also used, mostly in Microsoft systems.

Because Go (still) does not have built-in support for UUID types, module google/uuid is imported. It's one of the most complete, correct (and starred) modules nowadays (the other being github.com/gofrs/uuid.UUID).

This pull request introduces support for Universally Unique Identifiers (UUID) within gqlgen.

Many people may have already chosen a different UUID library:

models:
  UUID:
    model:
      - github.com/gofrs/uuid.UUID

@coveralls
Copy link

coveralls commented Aug 7, 2023

Coverage Status

coverage: 75.788% (+0.01%) from 75.777% when pulling 6fb1f49 on it512:master into 2d8673a on 99designs:master.

@StevenACoffman
Copy link
Collaborator

Ok, so this is just like PR #2749 but here the choice is github.com/google/uuid instead of there it is github.com/gofrs/uuid

Many people will have already chosen one of those two (or something else) and so will have:

models:
  UUID:
    model:
      - github.com/gofrs/uuid.UUID

Please add an example that uses this to verify that people can still override the default choice.

@it512
Copy link
Contributor Author

it512 commented Aug 7, 2023

UUID type

add to gqlgen.yalm

models:
  UUID:
    model:
      - github.com/99designs/gqlgen/graphql.UUID

add UUID scalar to schema.graphqls

scalar UUID

See the _examples/uuid package for more examples.

@it512
Copy link
Contributor Author

it512 commented Aug 7, 2023

add example in _examples/uuid and modify scalar doc (docs/content/reference/scalar.md)

@it512
Copy link
Contributor Author

it512 commented Aug 8, 2023

ok, thank you!

@it512
Copy link
Contributor Author

it512 commented Aug 10, 2023

Is there anything else that needs to be improved or revised?

Signed-off-by: Steve Coffman <steve@khanacademy.org>
@StevenACoffman
Copy link
Collaborator

Thanks for your patience. I was quite ill for a while, and I'm only now getting caught up at my day job so I can return to gqlgen. I added a commit that used the documentation from #2749 here (thanks!) and I'm merging this one.

@StevenACoffman StevenACoffman merged commit 153ec47 into 99designs:master Sep 8, 2023
17 checks passed
@0x221A
Copy link
Contributor

0x221A commented Sep 14, 2023

Is it better to return the null value instead of the zero value uuid?

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

Successfully merging this pull request may close these issues.

None yet

4 participants