Example #1
0
        public FaculdadeQuery(FaculdadeData data)
        {
            {
                Name = "Query";

                Field <AlunoType>(
                    "aluno",
                    arguments: new QueryArguments(
                        new QueryArgument <NonNullGraphType <StringGraphType> > {
                    Name = "cpf", Description = "cpf do aluno"
                }
                        ),
                    resolve: context => data.GetAlunoByCpfAsync(context.GetArgument <string>("cpf"))
                    );

                /*Func<ResolveFieldContext, string, object> func = (context, id) => data.GetProfessorByCpfAsync(id);
                 *
                 * FieldDelegate<ProfessorType>(
                 *  "droid",
                 *  arguments: new QueryArguments(
                 *      new QueryArgument<NonNullGraphType<StringGraphType>> { Name = "cpf", Description = "cpf do professor" }
                 *  ),
                 *  resolve: func
                 * );*/
            }
        }
Example #2
0
        public ProfessorType(FaculdadeData data)
        {
            Name = "Professor";

            Field(h => h.Cpf).Description("O CPF de um Professor.");
            Field(h => h.Nome, nullable: true).Description("O Nome de um Professor");
        }
Example #3
0
        public AlunoType(FaculdadeData data)
        {
            Name = "Aluno";

            Field(h => h.Cpf).Description("O CPF de um Aluno.");
            Field(h => h.Nome, nullable: true).Description("O Nome de um Aluno");
            /*Field(h => h.MateriasDeEstudo, nullable: true).Description("O Materias de um Aluno");*/
        }