Skip to content

Commit

Permalink
deploy: b4aeb35
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Jan 26, 2024
1 parent 6cd9f7a commit e687234
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 50 deletions.
10 changes: 5 additions & 5 deletions docs/0.18/resolvers.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h2><a class="anchor" aria-hidden="true" id="fallback-resolvers"></a><a href="#f
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="default-resolver"></a><a href="#default-resolver" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Default resolver</h2>
<p>Both <code>ObjectType.alias</code> and fallback resolvers use a default resolver provided by <code>graphql-core</code> library to implement its functionality.</p>
<p>This resolver takes a target attribute name and (depending if <code>obj</code> is a <code>dict</code> or not) uses either <code>obj.get(attr_name)</code> or <code>getattr(obj, attr_name, None)</code> to resolve the value that should be returned. If the resolved value is callable, it is called with arguments that were passed to the resolver field, and its return value is then used instead.</p>
<p>This resolver takes a target attribute name and (depending if <code>obj</code> is a <code>dict</code> or not) uses either <code>obj.get(attr_name)</code> or <code>getattr(obj, attr_name, None)</code> to resolve the value that should be returned. If the resolved value is a callable, it is then called with the <code>GraphQLResolveInfo</code> instance as only positional argument with field's arguments being passed as named arguments, and its return value is then used instead.</p>
<p>In the below example, both representations of <code>User</code> type are supported by the default resolver:</p>
<pre><code class="hljs css language-python">type_def = <span class="hljs-string">"""
type User {
Expand All @@ -239,16 +239,16 @@ <h2><a class="anchor" aria-hidden="true" id="default-resolver"></a><a href="#def
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">UserObj</span>:</span>
username = <span class="hljs-string">"admin"</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">likes</span><span class="hljs-params">(self)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">likes</span><span class="hljs-params">(self, info)</span>:</span>
<span class="hljs-keyword">return</span> count_user_likes(self)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initials</span><span class="hljs-params">(self, length)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initials</span><span class="hljs-params">(self, info, *, length)</span>:</span>
<span class="hljs-keyword">return</span> self.username[:length]

user_dict = {
<span class="hljs-string">"username"</span>: <span class="hljs-string">"admin"</span>,
<span class="hljs-string">"likes"</span>: <span class="hljs-keyword">lambda</span> obj, *_: count_user_likes(obj),
<span class="hljs-string">"initials"</span>: <span class="hljs-keyword">lambda</span> obj, *_, length: obj.username[:length]
<span class="hljs-string">"likes"</span>: <span class="hljs-keyword">lambda</span> info: count_user_likes(obj),
<span class="hljs-string">"initials"</span>: <span class="hljs-keyword">lambda</span> info, *, length: obj.username[:length]
}
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="query-shortcut"></a><a href="#query-shortcut" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Query shortcut</h2>
Expand Down
10 changes: 5 additions & 5 deletions docs/0.18/resolvers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h2><a class="anchor" aria-hidden="true" id="fallback-resolvers"></a><a href="#f
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="default-resolver"></a><a href="#default-resolver" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Default resolver</h2>
<p>Both <code>ObjectType.alias</code> and fallback resolvers use a default resolver provided by <code>graphql-core</code> library to implement its functionality.</p>
<p>This resolver takes a target attribute name and (depending if <code>obj</code> is a <code>dict</code> or not) uses either <code>obj.get(attr_name)</code> or <code>getattr(obj, attr_name, None)</code> to resolve the value that should be returned. If the resolved value is callable, it is called with arguments that were passed to the resolver field, and its return value is then used instead.</p>
<p>This resolver takes a target attribute name and (depending if <code>obj</code> is a <code>dict</code> or not) uses either <code>obj.get(attr_name)</code> or <code>getattr(obj, attr_name, None)</code> to resolve the value that should be returned. If the resolved value is a callable, it is then called with the <code>GraphQLResolveInfo</code> instance as only positional argument with field's arguments being passed as named arguments, and its return value is then used instead.</p>
<p>In the below example, both representations of <code>User</code> type are supported by the default resolver:</p>
<pre><code class="hljs css language-python">type_def = <span class="hljs-string">"""
type User {
Expand All @@ -239,16 +239,16 @@ <h2><a class="anchor" aria-hidden="true" id="default-resolver"></a><a href="#def
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">UserObj</span>:</span>
username = <span class="hljs-string">"admin"</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">likes</span><span class="hljs-params">(self)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">likes</span><span class="hljs-params">(self, info)</span>:</span>
<span class="hljs-keyword">return</span> count_user_likes(self)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initials</span><span class="hljs-params">(self, length)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initials</span><span class="hljs-params">(self, info, *, length)</span>:</span>
<span class="hljs-keyword">return</span> self.username[:length]

user_dict = {
<span class="hljs-string">"username"</span>: <span class="hljs-string">"admin"</span>,
<span class="hljs-string">"likes"</span>: <span class="hljs-keyword">lambda</span> obj, *_: count_user_likes(obj),
<span class="hljs-string">"initials"</span>: <span class="hljs-keyword">lambda</span> obj, *_, length: obj.username[:length]
<span class="hljs-string">"likes"</span>: <span class="hljs-keyword">lambda</span> info: count_user_likes(obj),
<span class="hljs-string">"initials"</span>: <span class="hljs-keyword">lambda</span> info, *, length: obj.username[:length]
}
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="query-shortcut"></a><a href="#query-shortcut" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Query shortcut</h2>
Expand Down
10 changes: 5 additions & 5 deletions docs/0.19/resolvers.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h2><a class="anchor" aria-hidden="true" id="fallback-resolvers"></a><a href="#f
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="default-resolver"></a><a href="#default-resolver" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Default resolver</h2>
<p>Both <code>ObjectType.alias</code> and fallback resolvers use a default resolver provided by <code>graphql-core</code> library to implement its functionality.</p>
<p>This resolver takes a target attribute name and (depending if <code>obj</code> is a <code>dict</code> or not) uses either <code>obj.get(attr_name)</code> or <code>getattr(obj, attr_name, None)</code> to resolve the value that should be returned. If the resolved value is callable, it is called with arguments that were passed to the resolver field, and its return value is then used instead.</p>
<p>This resolver takes a target attribute name and (depending if <code>obj</code> is a <code>dict</code> or not) uses either <code>obj.get(attr_name)</code> or <code>getattr(obj, attr_name, None)</code> to resolve the value that should be returned. If the resolved value is a callable, it is then called with the <code>GraphQLResolveInfo</code> instance as only positional argument with field's arguments being passed as named arguments, and its return value is then used instead.</p>
<p>In the below example, both representations of <code>User</code> type are supported by the default resolver:</p>
<pre><code class="hljs css language-python">type_def = <span class="hljs-string">"""
type User {
Expand All @@ -239,16 +239,16 @@ <h2><a class="anchor" aria-hidden="true" id="default-resolver"></a><a href="#def
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">UserObj</span>:</span>
username = <span class="hljs-string">"admin"</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">likes</span><span class="hljs-params">(self)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">likes</span><span class="hljs-params">(self, info)</span>:</span>
<span class="hljs-keyword">return</span> count_user_likes(self)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initials</span><span class="hljs-params">(self, length)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initials</span><span class="hljs-params">(self, info, *, length)</span>:</span>
<span class="hljs-keyword">return</span> self.username[:length]

user_dict = {
<span class="hljs-string">"username"</span>: <span class="hljs-string">"admin"</span>,
<span class="hljs-string">"likes"</span>: <span class="hljs-keyword">lambda</span> obj, *_: count_user_likes(obj),
<span class="hljs-string">"initials"</span>: <span class="hljs-keyword">lambda</span> obj, *_, length: obj.username[:length]
<span class="hljs-string">"likes"</span>: <span class="hljs-keyword">lambda</span> info: count_user_likes(obj),
<span class="hljs-string">"initials"</span>: <span class="hljs-keyword">lambda</span> info, *, length: obj.username[:length]
}
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="query-shortcut"></a><a href="#query-shortcut" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Query shortcut</h2>
Expand Down
10 changes: 5 additions & 5 deletions docs/0.19/resolvers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h2><a class="anchor" aria-hidden="true" id="fallback-resolvers"></a><a href="#f
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="default-resolver"></a><a href="#default-resolver" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Default resolver</h2>
<p>Both <code>ObjectType.alias</code> and fallback resolvers use a default resolver provided by <code>graphql-core</code> library to implement its functionality.</p>
<p>This resolver takes a target attribute name and (depending if <code>obj</code> is a <code>dict</code> or not) uses either <code>obj.get(attr_name)</code> or <code>getattr(obj, attr_name, None)</code> to resolve the value that should be returned. If the resolved value is callable, it is called with arguments that were passed to the resolver field, and its return value is then used instead.</p>
<p>This resolver takes a target attribute name and (depending if <code>obj</code> is a <code>dict</code> or not) uses either <code>obj.get(attr_name)</code> or <code>getattr(obj, attr_name, None)</code> to resolve the value that should be returned. If the resolved value is a callable, it is then called with the <code>GraphQLResolveInfo</code> instance as only positional argument with field's arguments being passed as named arguments, and its return value is then used instead.</p>
<p>In the below example, both representations of <code>User</code> type are supported by the default resolver:</p>
<pre><code class="hljs css language-python">type_def = <span class="hljs-string">"""
type User {
Expand All @@ -239,16 +239,16 @@ <h2><a class="anchor" aria-hidden="true" id="default-resolver"></a><a href="#def
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">UserObj</span>:</span>
username = <span class="hljs-string">"admin"</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">likes</span><span class="hljs-params">(self)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">likes</span><span class="hljs-params">(self, info)</span>:</span>
<span class="hljs-keyword">return</span> count_user_likes(self)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initials</span><span class="hljs-params">(self, length)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initials</span><span class="hljs-params">(self, info, *, length)</span>:</span>
<span class="hljs-keyword">return</span> self.username[:length]

user_dict = {
<span class="hljs-string">"username"</span>: <span class="hljs-string">"admin"</span>,
<span class="hljs-string">"likes"</span>: <span class="hljs-keyword">lambda</span> obj, *_: count_user_likes(obj),
<span class="hljs-string">"initials"</span>: <span class="hljs-keyword">lambda</span> obj, *_, length: obj.username[:length]
<span class="hljs-string">"likes"</span>: <span class="hljs-keyword">lambda</span> info: count_user_likes(obj),
<span class="hljs-string">"initials"</span>: <span class="hljs-keyword">lambda</span> info, *, length: obj.username[:length]
}
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="query-shortcut"></a><a href="#query-shortcut" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Query shortcut</h2>
Expand Down
Loading

0 comments on commit e687234

Please sign in to comment.