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

someEndpointsHaveNoGraphQLRepresentationAndMeDontLikeThat - Support for maps in the endpoints #1

Open
adamisntdead opened this issue Aug 3, 2018 · 3 comments

Comments

@adamisntdead
Copy link

Hey!

Just playing around with this today, and I was really just looking at the schemas being generated until I came across this gem:

type ruleGroups {
    thisTypeHasNoFieldsAndGraphQLDontLikeThat: Boolean
}

I'm going to have to be honest and say I don't really think that's gonna work, funny as it may be:

Can I make two suggestions on how to deal with this?

First, those types usually are just objects with keys, something like this in JSON:

(key): {
  ...
}

My suggestion would be turn that into a type like:

type {
  key: 'blahblah'
  ...
}

If that wouldn't work, I would change the initial type to something like:

type ruleGroups {
    thisTypeHasNoFieldsAndGraphQLDontLikeThat: Boolean
    json: String
}

And just do a JSON.stringify(...) and dump it in that json field

Thanks!

@rlancer
Copy link
Owner

rlancer commented Aug 3, 2018

@adamisntdead thanks for the feedback! I'm currently refactoring the code base to use TypeScript and will see if I come up with something more elegant for thisTypeHasNoFieldsAndGraphQLDontLikeThat, I initially added that in out of frustration but was always the goal to replace it with something more elegant.

@rlancer
Copy link
Owner

rlancer commented Aug 3, 2018

@adamisntdead which GAPI are you using?

@adamisntdead
Copy link
Author

I was trying to use pagespeed (I ended up writing my own bindings only for the fields I needed)

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