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 support for generic structs derriving InputObject and SimpleObject #1313

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

alisenai
Copy link
Contributor

@alisenai alisenai commented Jul 1, 2023

Description

Allows for generic structs which derive SimpleObject and InputObject to compile. For example:

#[derive(SimpleObject, InputObject)]
#[graphql(concrete(name = "MyObjectU32", params(u32)))]
#[graphql(concrete(name = "MyObjectString", params(String)))]
#[allow(dead_code)]
struct MyObject<T: InputType + OutputType> {
    a: T
}

Currently, this code generates the following error:

error[E0592]: duplicate definitions with name `__internal_create_type_info`
   --> tests/input_object.rs:412:14
    |
412 |     #[derive(SimpleObject, InputObject)]
    |              ^^^^^^^^^^^^  ----------- other definition for `__internal_create_type_info`
    |              |
    |              duplicate definitions for `__internal_create_type_info`

Please note that I have very little experience with this codebase outside of the public interface.

@sunli829 sunli829 merged commit 5ada58f into async-graphql:master Jul 15, 2023
8 checks passed
@sunli829
Copy link
Collaborator

Thanks! 🙂

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

2 participants