Spring Boot with GraphQL: API Fundamentals
Explore the basics of building APIs using Spring Boot and GraphQL.
Questions in this quiz
15 questions on Spring Boot with GraphQL: API Fundamentals. Work through them here, then start the quiz to answer them and see your score.
1.What is the primary purpose of using GraphQL in a Spring Boot application?
- ATo query and manipulate data with a single endpoint
- BTo replace SQL databases
- CTo enhance security features
- DTo define RESTful endpoints
2.Which Spring Boot starter is commonly used to integrate GraphQL?
- Aspring-boot-starter-data-jpa
- Bspring-boot-starter-graphql
- Cspring-boot-starter-security
- Dspring-boot-starter-web
3.In GraphQL, what is a 'query'?
- AA request to create data
- BA request to retrieve data
- CA request to delete data
- DA request to update data
4.What file format is typically used to define GraphQL schemas?
- AJSON
- BXML
- CYAML
- DSDL (Schema Definition Language)
5.Which annotation is used in Spring Boot to mark a method as a GraphQL query resolver?
- A@GraphQLResolver
- B@QueryResolver
- C@QueryMapping
- D@GraphQLQuery
6.What is the role of a 'mutation' in GraphQL?
- ATo modify data
- BTo retrieve data
- CTo define data types
- DTo secure data
7.Which of the following is NOT a benefit of using GraphQL?
- AReduced number of network requests
- BStrongly typed schema
- CAutomatic caching
- DSingle endpoint for data access
8.How do you specify a field as non-nullable in a GraphQL schema?
- ABy using the keyword 'nonnull'
- BBy using the keyword 'required'
- CBy prefixing the type with 'non-null'
- DBy adding an exclamation mark (!) after the type
9.What is the purpose of the @SchemaMapping annotation in Spring Boot with GraphQL?
- ATo map a method to a REST endpoint
- BTo secure a GraphQL endpoint
- CTo define a database schema
- DTo map a method to a GraphQL schema type
10.Which tool can be used to test GraphQL queries and mutations in a Spring Boot application?
- AGraphiQL
- BPostman
- CCurl
- DSwagger
11.In a GraphQL schema, what does the 'type' keyword define?
- AA security policy
- BA REST endpoint
- CA database table
- DA data type
12.What is the default HTTP method used by GraphQL queries?
- ADELETE
- BGET
- CPOST
- DPUT
13.Which component in a Spring Boot application handles GraphQL requests?
- AGraphQLServlet
- BGraphQLHandler
- CGraphQLService
- DGraphQLController
14.What is the purpose of the 'DataFetcher' interface in GraphQL with Spring Boot?
- ATo define GraphQL mutations
- BTo fetch data from a database
- CTo resolve fields in a GraphQL query
- DTo secure GraphQL endpoints
15.Which of the following is a key advantage of using GraphQL over REST?
- AVersioning is mandatory
- BClients can request exactly the data they need
- CMultiple endpoints for different resources
- DData is always cached