graphql-python / graphene-gae

GraphQL Support for Google AppEngine [DEPRECATED - Looking for maintainers]
http://docs.graphene-python.org/projects/gae/en/latest/
BSD 3-Clause "New" or "Revised" License
117 stars 14 forks source link

Expose NDB id in models #17

Closed ekampf closed 8 years ago

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.8%) to 96.543% when pulling 9947f38b1add68c9d31fff773df8131e10adf7f3 on feature/expose_ndb_ids into f354e7c7619482dfac96c530d17784e8be5982d1 on master.

syrusakbary commented 8 years ago

As a suggestion, as both id's are Strings and focus on the identity of a store key maybe you can cover both use cases with just one field that receives an argument.

Something like:

store_id = graphene.String(ndb=graphene.Boolean())

def resolve_store_id(root, args, context, info):
    if args.get('ndb'):
        return store_key.id()
    return store_key.urlsafe()

😉

ekampf commented 8 years ago

@syrusakbary thats way nicer!

ekampf commented 8 years ago

@syrusakbary WDYT now?

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.02%) to 98.361% when pulling 80589b4281183d71f54e6fc053af9af42a74f75a on feature/expose_ndb_ids into f354e7c7619482dfac96c530d17784e8be5982d1 on master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.02%) to 98.361% when pulling 80589b4281183d71f54e6fc053af9af42a74f75a on feature/expose_ndb_ids into f354e7c7619482dfac96c530d17784e8be5982d1 on master.

syrusakbary commented 8 years ago

Looks good!