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

Get pivots #11

Closed
ZirgVoice opened this issue Oct 5, 2021 · 2 comments
Closed

Get pivots #11

ZirgVoice opened this issue Oct 5, 2021 · 2 comments

Comments

@ZirgVoice
Copy link

Hi, can you tell me how to get pivot?
I tried this but it gives the error "Unknown kind of type: TodoTag"

Type(Todo.self) {
    Field("id", at: \.id)
    Field("title", at: \.title)
    Field("user", with: \.$user)
    Field("tags", with: \.$tags.$pivots)
}
@alexsteinerde
Copy link
Owner

Please make sure to register the TodoTag GraphQL type with Types(TodoTag.self) in your schema.
Example: https://github.com/GraphQLSwift/Graphiti/blob/af903a243862c6427935677b91f67df0c21f2a71/Tests/GraphitiTests/StarWarsAPI/StarWarsAPI.swift#L101

@ZirgVoice
Copy link
Author

ZirgVoice commented Oct 5, 2021

Thanks a lot, added Types (TodoTag.self) and it worked

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