How to use curl to access the github graphql API

You just need to escape the double quotes that are inside the JSON as the query $ curl -i -H ‘Content-Type: application/json’ -H “Authorization: bearer myGithubAccessToken” -X POST -d ‘{“query”: “query {repository(owner: \”wso2\”, name: \”product-is\”) {description}}”}’ https://api.github.com/graphql

import error ‘force_text’ from ‘django.utils.encoding’

in django 4.0 we dont have force_text https://docs.djangoproject.com/en/4.0/ref/utils/#module-django.utils.encoding instead change force_text to force_str linux: YOUR_VENV/lib/PYTHON_VERSION/site-packages/graphene_django/utils/utils.py windows: YOUR_VENV/lib/site-packages/graphene_django/utils/utils.py from django.utils.encoding import force_text to from django.utils.encoding import force_str and def _camelize_django_str(s): if isinstance(s, Promise): s = force_text(s) return to_camel_case(s) if isinstance(s, six.string_types) else s to def _camelize_django_str(s): if isinstance(s, Promise): s = force_str(s) return to_camel_case(s) if isinstance(s, … Read more

expressGraphQL is not a function

Please replace your expressGraphQL with graphqlHTTP as it was destructured Use: const { graphqlHTTP } = require(‘express-graphql’); or const expressGraphQL = require(‘express-graphql’).graphqlHTTP This is because a method called graphqlHTTP exist in the express-graphql module and you are destructure with another method name that does not exist in the module I also noticed that you have … Read more

How to document GraphQL with Swagger \ OpenAPI?

GraphQL APIs are usually documented through the documentation facilities provided by the GraphQL server itself: The type system and the descriptions on the types and fields. A tool like GraphQL playground lets you explore the API documentation through clicking/searching in a visual document tree or through IDE like features (autocomplete + tooltips). This is mostly … Read more

Apollo Client Cache vs. Redux

You’re comparing apples to oranges. Yes, at a high level both redux and apollo-client provide a way for you to manage global application state. However, redux allows you to create a predictable state container that changes in response to the actions you define. That means redux offers: Predictability. Reducers are pure functions — given the … Read more

Does apollo-client work on node.js?

Apollo Client should work just fine on Node. You only have to install cross-fetch. Here is a complete TypeScript implementation of Apollo Client working on Node.js. import { ApolloClient, gql, HttpLink, InMemoryCache } from “@apollo/client”; import { InsertJob } from “./graphql-types”; import fetch from “cross-fetch”; const client = new ApolloClient({ link: new HttpLink({ uri: process.env.PRODUCTION_GRAPHQL_URL, … Read more