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

DSLQuery with fragments #198

Closed
Samolevar opened this issue Mar 19, 2021 · 5 comments
Closed

DSLQuery with fragments #198

Samolevar opened this issue Mar 19, 2021 · 5 comments
Labels
type: feature A new feature

Comments

@Samolevar
Copy link

Samolevar commented Mar 19, 2021

Hi. Is it possible to create query with dsl if I need to pass a fragment or inline fragment within query?
No examples for that, and search didn't help either.
For example I want to create something like this:

query getNode {
  node(id: "1234") {
    id
    ... on Model {
      id
      name        
    }
  }
}
@KingDarBoja KingDarBoja added the type: question or discussion Issue discussing or asking a question about gql label Mar 20, 2021
@leszekhanusz
Copy link
Collaborator

Sorry, this is not implemented for dsl.
I agree that it is really needed.

@leszekhanusz leszekhanusz added type: feature A new feature and removed type: question or discussion Issue discussing or asking a question about gql labels Apr 6, 2021
@chadfurman
Copy link
Contributor

@Cito I see you added some support for inline fragments in graphql-python/graphql-core -- my friend @vedantpuri and I are looking at this right now and would like to try our hand at possibly adding this into the DSL module. I'm wondering if you can make any suggestions on what a super-simple minimal approach to this would be (i.e. perhaps not with like @include directives etc but just only supporting inline fragments to make working with interface types possible in the DSL)?

If you have any advice, I'd really appreciate it. The fact that it's supported in GQL Core tells me that it's probably extending DSLField or something of that sort with a different str method or similar. I'd be curious to hear your (or anyone else's) thoughts on the matter!

Thank you in advance :)

@Cito
Copy link
Member

Cito commented Aug 26, 2021

@chadfurman Yes, GraphQL-Core supports named and inline fragments. One idea how we could add this to the DSL is in PR #235.

@chadfurman
Copy link
Contributor

Great work! Thank you, I will play around with it locally. cc @leszekhanusz @syrusakbary

@leszekhanusz
Copy link
Collaborator

Fixed in version v3.0.0b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

No branches or pull requests

5 participants