Closed neetaBirajdar closed 1 year ago
Usually in every project that I worked with we use ID
(native type, opaque, but usually encoded as string).
However, we already expose some helpers, if you could provide a patch to https://github.com/profusion/sgqlc/tree/master/sgqlc/types/uuid.py (new file), see example at https://github.com/profusion/sgqlc/blob/master/sgqlc/types/datetime.py
It should be simple, remember to add docs and doctests to cover it.
Unfortunately I'm out of time to implement it myself, but will be glad to review and integrate it (shall the linters and tests pass, please run utils/git/install-git-hooks.sh
so you get the pre-commit hooks, or manually run utils/git/pre-push
Thank you so much for replying @barbieri. I will take care of adding this :) and raise Pull Request for this.
closed by #224
🚀 Feature Request
Add support for
UUID
insgqlc.types
Description
There are the following types supported by
sgqlc
:int, str, boolean, float, id, enum, union, datetime , non_null , list_of
(Maybe more)But there is no support for
UUID
.Most of the people who work with
databases
in the backend, need a unique identification for entities that they can use as aprimary key
. This can be of typestr
but not always.UUID
is used by many(including my organization). So, it would be great to have thisUUID Type
supported.Implementation details
For example: I want to create a
user
and update that with itsuuid
.The
class
for thisUser
will look like this:uuid
type in response:Variables:
{"code":"user_code", "name":"user_name"}
uuid
in request:Variables:
{"uuid": "94fda4fb-d574-470b-82e2-0f4ec2a2db90", "code":"user_code_updated", "name":"user_name_updated"}
Note: There is a library for the
uuid
type(https://docs.python.org/3/library/uuid.html) which can be referred to.Acceptance criteria
UUID
insgqlc.types