This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class Aluno { | |
private final String nome; | |
public Aluno(String nome){ | |
this.nome = nome; | |
} | |
public String getNome() { | |
return this.nome; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String nome = "Rafael Augusto"; | |
adicionaSobrenome(nome); | |
System.out.printlnn(nome); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class Aula { | |
private final Calendar inicio; | |
private final Calendar fim; | |
public Aula(Calendar inicio, Calendar fim){ | |
this.inicio = (Calendar) inicio.clone(); | |
this.fim = (Calendar) fim.clone(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### Erro apresentado ########### | |
{ MongooseError: Path `login` is required. | |
at ValidatorError (C:\GitHub\eSports-team\Back\node_modules\mongoose\lib\error\validator.js:24:11) | |
at validate (C:\GitHub\eSports-team\Back\node_modules\mongoose\lib\schematype.js:705:13) | |
at C:\GitHub\eSports-team\Back\node_modules\mongoose\lib\schematype.js:750:9 | |
at Array.forEach (native) | |
at SchemaString.SchemaType.doValidate (C:\GitHub\eSports-team\Back\node_modules\mongoose\lib\schematype.js:711:19) | |
at C:\GitHub\eSports-team\Back\node_modules\mongoose\lib\document.js:1408:9 | |
at _combinedTickCallback (internal/process/next_tick.js:73:7) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query: | |
{ usuario { | |
nome, | |
idade, | |
} | |
} | |
Retorno: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Endpoint: | |
GET localhost/api/usuários | |
Retorno: | |
{nome: "rafael", idade: 21, sexo: "Masculino"}, | |
{nome: "Maria", idade: 19, sexo: "Feminino"}, | |
{nome: "Filype", idade: 16, sexo: "Masculino"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Usario { | |
nome: String, | |
idade: Int, | |
sexo: String, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const RootQuery = ` | |
type RootQuery { | |
posts: [Post] | |
post(id:Int!): Post | |
usuarios: [Usuario] | |
usuario(id:Int!): Usuario | |
} | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const RootMutation = ` | |
type RootMutation { | |
createPost(input: PostInput!): Post | |
} | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resolvers: { | |
RootQuery: { | |
posts: () => posts, | |
post: async (_, { id }) => | |
await Post.query() | |
}, | |
RootMutations: { | |
createPost: async (_, { input }) => | |
await Post.query.insert(input) | |
}, |