GraphQL is a query language for API’s.It is a runtime for fulfilling those query’s with your existing data. GraphQL provides a complete description of the data in your API. It gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
- What are the valid graphQL operation?
a. Query
b. Mutation
c. Subscription
d. All of these
- Working with GraphQL has following major advantages.
a. No Overfetching
b. Single source of truth
c. Typed Query Language
d. Declartive data fetching
e. All of the operation
- Apollo provides only client side libraries support and not for the server side.
a. True
b. False
- Apollo’s ecosystem is stable for other major languages as well.
a. True
b. False
- Apollo uses below operation to fetch data from server.
a. Query
b. Mutation
- GrapgQL “fragments” are used to share common fields in multiple operation.
a. True
b. False
- There is a limitation in “fragments”. We can share pieces of logic for “queries” only but cannot for “mutation”.
a. True
b. False
- Variables in grapgQL starts with “$” sign
a. True
b. False
- We use below sign to make fields mandatory/not null in GraphQL.
a. $
b. —
c. !
d. @
e. None of the option
- Data graph uses a “Schema” to define data and its type.
a. True
b. False
- For every “query”. We need to write its resolver function.
a. True
b. False
- “ApolloProvider” wraps the whole React app so that we can access it from anywhere throughout the app
a. True
b. False
- What is the correct syntax to use the “ useQuery” hook in react?
a. Cont{ loading, error,data} =useQuery(GET_LIST)
b. Cont { data, error, loading} =useQuery(GET_LIST)
c. Const {error, data, loading} = useQuery(GET LIST)
d. None of the options
- What is the correct syntax of using the “useQuery” hook along with variable.
(“GET _LIST” is a constant containing a gql query)
a. Const{ loading, error, data} = useQuery(GET_LIST {variable {fruits, “Mango”}})
b. Const{ loading, error, data} = useQuery({variables (fruit, “Mango”},)GET_LIST)
c. Const{ loading, error, data} = useQuery(GET_LIST, {variables {fruit, “Mango”}})
d. None of the option
- What is the correct syntax of using the “useMutation” hook in react?
a. Const[addTodo,{data}] = useMutation(ADD_TODO);
b. Const{addTodo, data} = useMutation(ADD_TODO);
c. Const[addTodo, data ] = useMutation(ADD_TODO)
d. None of the options
- We use “subscritions” operation to get live event updates from server
a. True
b. False
- Apollo client supports the following error policies for an..
a. Ignore
b. None
c. None of these
- This is not possible to update “Headers” in graphQL requests
a. True
b. False
- It is a beauty of graphQL subscriptions that it does not uses “pub/sub” pattern
a. True
b. False
- Apollo client store the results of its queries in the following way.
a. In memory cache
b. Database
c. Local File
d. Apollo cache
- Which of the following pattern is used GraphQL’s Subscription.
a. Pub/sub
b. Request/response
c. Streaming
d. None of the options
- Which of the following GraphQL’s hooks
a. useQuery
b. useLazyQuery
c. useQueryLazy
d. None of these
- Which of the following GraphQL’s hooks should be used to update data on server
a. useQuery
b. useMutation
c. useSubscription
d. none of the options
Read More: Most Important React JS Interview Questions and Answers 2021
Great information. Lucky me I ran across your blog by chance
(stumbleupon). I have bookmarked it for later!