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

name struct breaks #[Object] macro #1598

Closed
musjj opened this issue Sep 22, 2024 · 1 comment
Closed

name struct breaks #[Object] macro #1598

musjj opened this issue Sep 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@musjj
Copy link

musjj commented Sep 22, 2024

Expected Behavior

The presence of a struct called name should not break #[Object] macro.

Actual Behavior

#[Object] macro breaks under the presence of a struct called name.

Steps to Reproduce the Problem

use async_graphql::Object;

struct name; // remove to fix error

pub struct Query;

#[Object] // mismatched types expected `Name`, found `name`
impl Query {
    ...
}

This seems like a very niche issue, but with diesel, you often need to import structs generated and named from your database columns. Like this:

use schema::users::dsl::{name /* <- this is a struct */, username};

Is there a workaround to this, other than refactoring your database?

Specifications

  • Version: v7.0.9
  • Platform: Linux
  • Subsystem: NixOS 24.11
@musjj musjj added the bug Something isn't working label Sep 22, 2024
@sunli829
Copy link
Collaborator

fixed in v7.0.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants