<commit_before># Defining your schema
Since 0.9.0

[Type language](http://graphql.org/learn/schema/#type-language) is a convenient way to define your schema,
especially with IDE autocompletion and syntax validation.

Here is a simple schema defined in GraphQL type language (e.g. in a separate **schema.graphql** file):

```graphql
schema {
    query: Query
    mutation: Mutation
}

type Query {
    greetings(input: HelloInput!): String!
}

input HelloInput {
    firstName: String!
    lastName: String
}
```

In order to create schema instance out of this file, use 
[`GraphQL\Utils\BuildSchema`](../reference.md#graphqlutilsbuildschema):

```php
<?php
use GraphQL\Utils\BuildSchema;

$contents = file_get_contents('schema.graphql');
$schema = BuildSchema::build($contents);
```

By default, such schema is created without any resolvers.

We have to rely on [default field resolver](../data-fetching.md#default-field-resolver) and **root value** in 
order to execute a query against this schema.

# Performance considerations
Since 0.10.0
<commit_msg>Restore "Defining resolvers" documentation<commit_after># Defining your schema
Since 0.9.0

[Type language](http://graphql.org/learn/schema/#type-language) is a convenient way to define your schema,
especially with IDE autocompletion and syntax validation.

Here is a simple schema defined in GraphQL type language (e.g. in a separate **schema.graphql** file):

```graphql
schema {
    query: Query
    mutation: Mutation
}

type Query {
    greetings(input: HelloInput!): String!
}

input HelloInput {
    firstName: String!
    lastName: String
}
```

In order to create schema instance out of this file, use 
[`GraphQL\Utils\BuildSchema`](../reference.md#graphqlutilsbuildschema):

```php
<?php
use GraphQL\Utils\BuildSchema;

$contents = file_get_contents('schema.graphql');
$schema = BuildSchema::build($contents);
```

By default, such schema is created without any resolvers.

We have to rely on [default field resolver](../data-fetching.md#default-field-resolver) and **root value** in 
order to execute a query against this schema.

# Defining resolvers
Since 0.10.0

In order to enable **Interfaces**, **Unions** and custom field resolvers you can pass the second argument:
**type config decorator** to schema builder.

It accepts default type config produced by the builder and is expected to add missing options like
[**resolveType**](interfaces.md#configuration-options) for interface types or
[**resolveField**](object-types.md#configuration-options) for object types.

```php
<?php
use GraphQL\Utils\BuildSchema;

$typeConfigDecorator = function($typeConfig, $typeDefinitionNode) {
    $name = $typeConfig['name'];
    // ... add missing options to $typeConfig based on type $name
    return $typeConfig;
};

$contents = file_get_contents('schema.graphql');
$schema = BuildSchema::build($contents, $typeConfigDecorator);
```

# Performance considerations
Since 0.10.0

{'fraction_non_alphanumeric': 0.11436351259360109, 'fraction_numerical': 0.006126616746085773, 'mean_word_length': 4.901606425702811, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '106183', 'n_tokens_mistral': 882, 'n_tokens_neox': 850, 'n_words': 298}