Skip to content
ไทย

Best for integrating Politigraph data into a website, application, or other workflows by writing a GraphQL query and sending it to the API to fetch the data you need.

Our API adheres to the GraphQL standard, which you can query at https://politigraph.wevis.info/graphql through a GraphQL Client or HTTP POST Request. For example:

import { ApolloClient, HttpLink, InMemoryCache, gql } from '@apollo/client';
const client = new ApolloClient({
link: new HttpLink({
uri: 'https://politigraph.wevis.info/graphql',
headers: { 'apollographql-client-name': 'my-app' },
}),
cache: new InMemoryCache(),
});
const { data } = await client.query({
query: gql`
query {
people(where: { firstname_en: { eq: "Anutin" } }) {
id
name_en
}
}
`,
});

If you call the API from a server, script, or SSR, please send the apollographql-client-name header and, optionally, apollographql-client-version so we can see usage statistics. Requests from a browser are already identified by their origin automatically.