GraphQL

From BC$ MobileTV Wiki
Jump to: navigation, search

GraphQL is a query language meant to be used for APIs, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.

A GraphQL service is created by defining types and fields on those types, then providing functions for each field on each type. For example, a GraphQL service that tells us who the currently logged in user is on my device (i.e. "me") as well as that user's name might look something like this:

type Query {
  me: User
}
type User {
  id: ID
  name: String
}

Along with functions for each field on each type:

function Query_me(request) {
  return request.auth.user;
}
function User_name(user) {
  return user.getName();
}



Tools


Resources


Tutorials

[3] [4]

[5] [6]

[7] [8] [9]


External Links


References

  1. How I started testing my Queries and Mutations on GraphQL: https://medium.com/open-graphql/how-i-started-testing-my-queries-and-mutations-on-graphql-f578abc1b424
  2. Getting started with GraphQL in Java: https://www.howtographql.com/graphql-java/1-getting-started/
  3. GraphQL And REST Differences Explained With Burgers: https://apievangelist.com/2018/06/29/rest-api-and-graphql-burger-king/
  4. GraphQL vs. REST, Explained Using Pizza: https://medium.com/@kilkelly/graphql-vs-rest-explained-using-pizza-74d220aa60cc
  5. How to test a GraphQL API?: https://stackoverflow.com/questions/42841902/how-to-test-a-graphql-api
  6. GraphQL Test Automation with KarateDSL: https://www.youtube.com/watch?v=If9V-tG_gRs
  7. Why You Should Disable GraphQL Introspection In Production – GraphQL Security: https://www.apollographql.com/blog/graphql/security/why-you-should-disable-graphql-introspection-in-production/
  8. GraphQL Ruby client/server -- Disabling "introspection" (schema self-describing/discovery): https://graphql-ruby.org/schema/introspection.html#disabling-introspection
  9. How to Disable Schema Introspection in graphql-spqr-spring-boot-starter: https://stackoverflow.com/questions/64520366/how-to-disable-schema-introspection-in-graphql-spqr-spring-boot-starter

See Also

SQL | NoSQL | JS | Java | RDF | SPARQL | API