dotansimha / dotansimha/graphql-code-generator

Interfaces forcing c# 8.0, is this intended?

Open
#5,600 1 comment 1 reaction 0 assignees View on GitHub
help wanted kind/enhancement plugins
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

**Describe the bug**
When we have an interface in the graphl schema the generated c# interface properties will have a public prefix making them a c# 8.0 feature.

Schema
```
interface Product {
articles: [Article!]!
}
```

C#
```
public interface Product {
[JsonProperty("articles")]
public List articles { get; set; }
}
```

I guess the `public`part here should probably be omitted? Or is this intended?

1. My GraphQL schema:

```graphql
# Put your schema here
```

2. My GraphQL operations:

```graphql
# Put your operations here
```

3. My `codegen.yml` config file:

```yml
overwrite: true
schema: "https://somedomain/graphql"
documents: "./src/graphql/**/*.graphql"
generates:
./src/GraphQL/Client/GraphQLClientServices.generated.cs:
config:
namespaceName: SomeNameSpace
typesafeOperation: false
plugins:
- c-sharp
- c-sharp-operations
```

**Expected behavior**
I expect the output to not include the public part.

**Environment:**

- OS:
Windows / Git Bash
```
"@graphql-codegen/c-sharp-operations": "^1.18.0",
"@graphql-codegen/cli": "^1.20.1",
"@graphql-codegen/typescript": "^1.20.2",
"@graphql-codegen/typescript-graphql-request": "^3.0.2",
"@graphql-codegen/typescript-operations": "^1.17.14",
```
- NodeJS: v14.15.1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.