# GraphQL The GraphQL component abstracts [thecodingmachine/graphqlite](https://github.com/thecodingmachine/graphqlite). ## Install ```bash composer require hyperf/graphql ``` ## Quick start ### Simple query ```php getBody()->getContents(); $input = json_decode($rawInput, true); $query = $input['query']; $variableValues = isset($input['variables']) ? $input['variables'] : null; return GraphQL::executeQuery($this->schema, $query, null, null, $variableValues)->toArray(); } #[Query] public function hello(string $name): string { return $name; } } ``` Inquire: ```graphql { hello(name: "graphql") } ``` Response: ```json { "data": { "hello": "graphql" } } ``` ### Typemap ```php name = $name; $this->price = $price; } #[Field] public function getName(): string { return $this->name; } #[Field] public function getPrice(): ?float { return $this->price; } } ``` Add in `GraphQLController` ```php