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

RFC Custom Wrapping Types (Generics) #21

Open
greabock opened this issue Oct 23, 2017 · 2 comments
Open

RFC Custom Wrapping Types (Generics) #21

greabock opened this issue Oct 23, 2017 · 2 comments

Comments

@greabock
Copy link
Member

greabock commented Oct 23, 2017

Just a bookmark )

wrapper Page($ofType: Type) {
    total: Int
    list: [$ofType!]!
}

type Query {
    users(page: Int, perPage: Int): Page(ofType: User)
}
@greabock
Copy link
Member Author

greabock commented Oct 27, 2017

After discussion we came to the conclusion that regular objectype actualy is wrapper too. But without arguments of constructor. So we decided do away with special keyword for wrapping.

type Some {
    foo: Bar,
    baz: Bar
}
// acutaly is same thing as

type Some () {
    foo: Bar,
    baz: Bar
}

@SerafimArts
Copy link
Member

SerafimArts commented Oct 27, 2017

I think that in addition it is worth mentioning this issue: #24 He is responsible for type declarations for these wrappings, like:

type Some($foo: Scalar) { ... }

type Test {
    field: Some(foo: MyEnum)
}

@SerafimArts SerafimArts changed the title Custom Wrapping Types RFC Custom Wrapping Types Dec 19, 2017
@SerafimArts SerafimArts changed the title RFC Custom Wrapping Types RFC Custom Wrapping Types (Generics) Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants