Git Product home page Git Product logo

Comments (7)

yfilali avatar yfilali commented on June 4, 2024

@hansbonini I'll take a look tonight. It looks like they just need to be added to https://github.com/yfilali/graphql-pynamodb/blob/master/graphene_pynamodb/converter.py

from graphql-pynamodb.

hansbonini avatar hansbonini commented on June 4, 2024

Thx, this attribute is very important.

from graphql-pynamodb.

yfilali avatar yfilali commented on June 4, 2024

@hansbonini Any chance you can give the change a try? I added a few tests, but I need to add more before I publish the package. It would be helpful to have someone else try it especially if you have an existing schema with List and Map attributes.

from graphql-pynamodb.

yfilali avatar yfilali commented on June 4, 2024

Pypi package pushed, let me know if you see any issues with the new attributes

from graphql-pynamodb.

hansbonini avatar hansbonini commented on June 4, 2024

I'll take a look! Thanks

from graphql-pynamodb.

daksharma avatar daksharma commented on June 4, 2024

Would you be able to add examples (in the folder) on how to create query on Map/List Attributes.
ex:

class ReceiptItem(MapAttribute):
    name = UnicodeAttribute()
    quantity = NumberAttribute()
    price = NumberAttribute()

class Receipt(Model):
    ...
    id = UnicodeAttribute(hash_key = True)
    items = ListAttribute(null = False, of = ReceiptItem)

class User(Model):
    ...
    name = UnicodeAttribute(null = False)
    receipts = OneToMany(Receipt)

class Query(graphene.ObjectType):
    node = relay.Node.Field()
    all_users = PynamoConnectionField(User)
    # ???

schema = graphene.Schema(query = Query, types = [User, Receipt])

not sure how to properly get the query for this. In the GraphiQL i get the memory address from the local DynamoDB as a string. I've been learning graphene-pynamodb but kind of got stuck here when trying to create this example.

...
receipts {
          edges {
            node {
              items
            }
          }
        }
...

in the Graphiql docs it shows up as items: [String]

<model.Receipt.ReceiptItem object at 0x10cb66550>

Any help is appreciated. Awesome Python module. :)

from graphql-pynamodb.

petecocoon avatar petecocoon commented on June 4, 2024

Same issue here, i haven't understand if is an issue of this module or if is a graphene issue, @daksharma did you solve it?

from graphql-pynamodb.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.