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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazing 馃ぉ #1

Open
oskarhane opened this issue Dec 29, 2020 · 1 comment
Open

Amazing 馃ぉ #1

oskarhane opened this issue Dec 29, 2020 · 1 comment

Comments

@oskarhane
Copy link
Collaborator

This is fantastic @danstarns!

I love this way of showing usages and needs of patterns and API:s.
Great resource for people trying out the alpha and for dev-rel to learn how to use it.

Not sure of you want my view on the new pieces of the API (and the typedefs), but here they come :)

  1. Not sure about the @timestamps directive. Or to be more precise, I'm not sure about the implicit part where they add fields automatically. It's certainly convenient for the developer though, so I'm a bit torn.
  2. @readonly on the password seems wrong in a real world app.
  3. Not a big fan of canEdit and canDelete being root level fields on the Post, it would make more sense to have a PostPermissions type on a permissions field on the Post instead. But that might be hard to do?
  4. The showcase of the OGM in signUp and signIn is great 馃憤
  5. Great to see the visualization from Arrows.
  6. You're doing crazy good work 馃巹
@danstarns
Copy link
Owner

@oskarhane Hello & thank you for taking a look. Great to see your opinions :) 馃巹

I completely agree with you on the implicitness of the @timestamps directive. It auto-populates properties createdAt & updatedAt. While being common properties, for library implementing timestamps, they still pose a barrier to entry. I quickly settled on the current implementation, completely open to discussion, as I deemed timestamps something necessary to showcase a 'real world like' application.

Good spot on the password @readonly I forgot to mention about the just added section to the README here

Your comments on canEdit and canDelete are really valuable because i tried to implement your suggestion;

type PostPermissions {
    canDelete: Boolean @cypher(statement: """
        RETURN false
    """)
}

type Movie {
    id: ID
    postPermissions: PostPermissions
}

Unforchunetly it dont work as intended just yet & neither does it in neo4j-graphql-js. Something we should implement in the near future. I feel it would work well with ignored directives because we may not want users creating PostPermissions nodes in the database.

type PostPermissions @ignored(resolvers: "*") {
    canDelete: Boolean @cypher(statement: """
        RETURN false
    """)
}

type Movie {
    id: ID
    postPermissions: PostPermissions
}

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

No branches or pull requests

2 participants