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 SQLAlchemyList and SQLAlchemy mutations types #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Toilal
Copy link

@Toilal Toilal commented Nov 14, 2017

This brings default support for fields filtering and ordering on queries and mutations.

This is a work in progress for comments, please do not merge for now.

@coveralls
Copy link

Coverage Status

Coverage decreased (-14.4%) to 76.389% when pulling a8f6718 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-14.4%) to 76.389% when pulling a8f6718 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-14.4%) to 76.389% when pulling a8f6718 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage decreased (-14.4%) to 76.389% when pulling 6945888 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-14.4%) to 76.389% when pulling 6945888 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-14.4%) to 76.389% when pulling ffc4d71 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-14.4%) to 76.389% when pulling ffc4d71 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-14.4%) to 76.389% when pulling ffc4d71 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage decreased (-14.5%) to 76.334% when pulling 365a0ec on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage decreased (-4.7%) to 86.079% when pulling 596a72b on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage increased (+0.1%) to 90.951% when pulling ae30f00 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage increased (+0.9%) to 91.667% when pulling 9936191 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage increased (+0.8%) to 91.579% when pulling f89fa11 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage increased (+1.2%) to 92.008% when pulling 894517d on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

This brings default support for fields filtering and ordering on queries and mutations.
@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage increased (+1.2%) to 91.992% when pulling 919bbd6 on Toilal:filtering-and-relationships into ecd9a91 on graphql-python:master.

@Toilal
Copy link
Author

Toilal commented Nov 16, 2017

There's only an update_all mutation missing I think now. Could you review this pull request ? Maybe it requires some documentation update too ?

@Toilal Toilal changed the title [WIP] Add SQLAlchemyList and SQLAlchemyMutation types Add SQLAlchemyList and SQLAlchemyMutation types Nov 16, 2017
@Toilal Toilal changed the title Add SQLAlchemyList and SQLAlchemyMutation types Add SQLAlchemyList and SQLAlchemy mutations types Nov 16, 2017
@amilstead
Copy link

+1 Looking forward to this in a release so I can remove my copy-pasta of this diff in my own codebase.

@robjampar
Copy link

+1 yeah this looks really useful

@XiaoMouR
Copy link

XiaoMouR commented Jan 4, 2018

Cool jobs!

----update----
A little question with the code as follows

class Tags(SQLAlchemyObjectType):
    class Meta:
        model = models.Tags  # a SQLAlchemy model that contains two columns (id,name)
        interfaces = (graphene.relay.Node, )

class UpdateTags(SQLAlchemyUpdate):
    class Meta:
        model = models.Tags
    Output = Tags

class Query(graphene.ObjectType):
    tags = SQLAlchemyConnectionField(Tags)

class Mutation(graphene.ObjectType):
    update_tags = UpdateTags.Field()

schema = graphene.Schema(query=Query, mutation=Mutation)

I get a tag with result {"id":"VGFnczox","name":"test"}, but the follows mutation won't success.

mutation{
  update_tags(id:"VGFnczox",name:"test2"){
    id
    name
  }
}

I track the excution and find that SQLAlchemyUpdate's mutate will accept id as VGFnczox instead of translate it to an integer, which causes UpdateTags failed.
So far, my testing has been limited to the GraphiQL console, so am I missing something?

@qubitron
Copy link

@Toilal re: relationships I've left some comments on #29 on how I've been handling them.

@Toilal
Copy link
Author

Toilal commented Jan 16, 2018

I've actually abandonned trying to implement a GraphQL service with Python :(.

(switched back to REST and Spring/Kotlin)

@alexisrolland
Copy link

Bump, I'd love to see this implemented in graphene-sqlalchemy.
Thanks @Toilal for your contribution on this.

@flewellyn
Copy link

I can confirm that this works beautifully, and is precisely what I needed. How soon can this be merged?

@macic
Copy link

macic commented Feb 5, 2018

Hey, can this be merged, after resolving the conflict?

@kavink
Copy link

kavink commented Feb 5, 2018

@Toilal Would it be possible to resolve the conflict also if possible would be great to update the README or the documentation with usage/example or some blurb about this feature, @syrusakbary Any idea who the maintainer of this repo is and if they can review and merge this PR ?

@lorcanoeire
Copy link

Great feature. How soon can the PR be merged?!

Tryph added a commit to Tryph/graphene-sqlalchemy that referenced this pull request Feb 28, 2018
@arlobryer
Copy link

This would be very useful for us too - currently looking into how we generate mutates straight from SQLAlchemy model. Looks like this would do it 😀 .

@nayak16
Copy link

nayak16 commented May 1, 2018

Any word from the authors about when this would be merged?

@syrusakbary
Copy link
Member

I would take a look on this PR soon, sorry for the delay.

@qubitron
Copy link

qubitron commented Aug 4, 2018

@syrusakbary note that there's been quite a bit of improvements to these classes on #29, the latest versions are available as gists in that issue

@yoursdearboy
Copy link

Any updates?

@danaronson
Copy link

any updates?

@NJannasch
Copy link

Any updates?

2 similar comments
@TeaDove
Copy link

TeaDove commented Jun 8, 2021

Any updates?

@pgzmnk
Copy link

pgzmnk commented Dec 20, 2021

Any updates?

@palisadoes
Copy link
Collaborator

My organization has been using graphene-sqlalchemy-filter for filtering, however the repo has become inactive. Would anyone on this thread be interested in integrating the graphene-sqlalchemy-filter features into graphene-sqlalchemy as a sponsored activity?

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