<commit_before># Blog Example

Simple yet full-featured example of GraphQL API.
Models a blogging platform with Stories, Users and hierarchical comments. 

## Start the Server

```sh
php -S localhost:8080 graphql.php
```

## Check the Response

Opening `http://localhost:8080` in your browser should return the following response:

```json
{
  "data": {
    "hello": "Your graphql-php endpoint is ready! Use a GraphQL client to explore the schema."
  }
}
```

## Explore the Schema

The most convenient way to explore a GraphQL schema is to use a GraphQL client.
We recommend you download and install [Altair](https://altair.sirmuel.design).

Set `http://localhost:8080` as your GraphQL endpoint and try clicking the "Docs" button
to explore the schema definition.

## Running GraphQL Queries

Copy the following query to your GraphQL client and send the request:

```graphql
{
  viewer {<commit_msg>Updated README for 01-blog example. (#878)<commit_after># Blog Example

Simple yet full-featured example of GraphQL API.
Models a blogging platform with Stories, Users and hierarchical comments. 

## Start the Server

```sh
php -S localhost:8080 graphql.php
```

### Try query
```
curl -d '{"query": "query { hello }" }' -H "Content-Type: application/json" http://localhost:8080
```

and response should be:

```json
{
  "data": {
    "hello": "Your graphql-php endpoint is ready! Use a GraphQL client to explore the schema."
  }
}
```

## Explore the Schema

The most convenient way to explore a GraphQL schema is to use a GraphQL client.
We recommend you download and install [Altair](https://altair.sirmuel.design).

Set `http://localhost:8080` as your GraphQL endpoint and try clicking the "Docs" button
to explore the schema definition.

## Running GraphQL Queries

Copy the following query to your GraphQL client and send the request:

```graphql
{
  viewer {
{'fraction_non_alphanumeric': 0.0997319034852547, 'fraction_numerical': 0.015549597855227882, 'mean_word_length': 4.256338028169014, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1973795', 'n_tokens_mistral': 577, 'n_tokens_neox': 530, 'n_words': 239}