GraphQL interfaces should still be annotated when using the `@annotate` directive

Abierto
#687 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
graphql, java, kotlin

Línea de trabajo

Comienza con el ejemplo de esquema GraphQL y el procesamiento de la directiva @annotate para interfaces generadas; después, revisa las pruebas de generación existentes, si están disponibles. Añade un caso de regresión que cubra las anotaciones en una interfaz y determina si la generación debe aplicarlas o informar de que el uso no está admitido; se considera terminado cuando el comportamiento está cubierto y coincide con el resultado elegido.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Given an interface and a type, both of which have the @annotate directive placed on them, annotations are only generated for the GraphQL type.

For example (you can also find it as a cloneable repo):

interface TestInterface @annotate(name: "com.example.badinterfacegeneration.TestAnnotation") {
    name: String! @annotate(name: "com.example.badinterfacegeneration.TestAnnotation", target: "get")
}

type TestType @annotate(name: "com.example.badinterfacegeneration.TestAnnotation") {
    name: String! @annotate(name: "com.example.badinterfacegeneration.TestAnnotation", target: "get")
}

generates the following class:

@TestAnnotation
public class TestType {
  private String name;

  public TestType() {
  }

  public TestType(String name) {
    this.name = name;
  }

  @TestAnnotation
  public String getName() {
    return name;
  }
  // ... the rest of the generated code
}

and interface:

public interface TestInterface {
  String getName();

  void setName(String name);
}

The Interface does not have any annotations despite having them defined in the GraphQL schema. This is not the behaviour I expect. There should either be an error that indicates that annotations cannot be placed on interfaces or annotations should be placed on the generated interface.

I don't know how feasible this feature is to implement. If it is not possible, an addition to the documentation or a warning during generation would be nice.

Lenguaje dominante
Kotlin
Estrellas
220
Forks
123
Merge medio
1 d 6 h
PR fusionados (30 d)
23

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Netflix/dgs-codegen

Todos los issues de Netflix/dgs-codegen

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.