Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix typo" #609

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guide/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Authentication

# Authentication

> [!WARNING]
> ![WARNING]
> This solution is enough for web browsers, but will not work for clients that
> doesn't have a way to store cookies in it (e.g. mobile apps). For those it is
> recommended to use token authentication methods. JWT can be used with
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/export-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Export Schema

# Export Schema

> [!INFO]
> ![INFO]
> The `export_schema` management command provided here is specifically designed for use with `strawberry_django`. The [default Strawberry export command](https://strawberry.rocks/docs/guides/schema-export) won't work with `strawberry_django` schemas because `strawberry_django` extends the base functionality of Strawberry to integrate with Django models and queries. This command ensures proper schema export functionality.

The `export_schema` management command allows you to export a GraphQL schema defined using the `strawberry_django` library. This command converts the schema definition to GraphQL schema definition language (SDL), which can then be saved to a file or printed to the console.
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Defining Fields

# Defining Fields

> [!TIP]
> ![TIP]
> It is highly recommended to enable the [Query Optimizer Extension](optimizer.md)
> for improved performance and avoid some common pitfalls (e.g. the `n+1` issue)

Expand All @@ -27,7 +27,7 @@ class Fruit2:
name: str
```

> [!TIP]
> ![TIP]
> For choices using
> [Django's TextChoices/IntegerChoices](https://docs.djangoproject.com/en/4.2/ref/models/fields/#enumeration-types)
> it is recommented using the [django-choices-field](/integrations/choices-field) integration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (documentation): Typo in the word 'recommented'.

The word 'recommented' should be 'recommended'.

Expand Down Expand Up @@ -122,7 +122,7 @@ field_type_map.update({

## Including / excluding Django model fields by name

> [!WARNING]
> ![WARNING]
> These new keywords should be used with caution, as they may inadvertently lead to exposure of unwanted data. Especially with `fields="__all__"` or `exclude`, sensitive model attributes may be included and made available in the schema without your awareness.

`strawberry_django.type` includes two optional keyword fields to help you populate fields from the Django model, `fields` and `exclude`.
Expand Down
12 changes: 6 additions & 6 deletions docs/guide/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Fruit:
...
```

> [!TIP]
> ![TIP]
> In most cases filter fields should have `Optional` annotations and default value `strawberry.UNSET` like so:
> `foo: Optional[SomeType] = strawberry.UNSET`
> Above `auto` annotation is wrapped in `Optional` automatically.
Expand All @@ -40,7 +40,7 @@ input FruitFilter {
}
```

> [!TIP]
> ![TIP]
> If you are using the [relay integration](relay.md) and working with types inheriting
> from `relay.Node` and `GlobalID` for identifying objects, you might want to set
> `MAP_AUTO_ID_AS_GLOBAL_ID=True` in your [strawberry django settings](../settings)
Expand Down Expand Up @@ -204,11 +204,11 @@ class FruitFilter:
)
```

> [!WARNING]
> ![WARNING]
> It is discouraged to use `queryset.filter()` directly. When using more
> complex filtering via `NOT`, `OR` & `AND` this might lead to undesired behaviour.

> [!TIP]
> ![TIP]
>
> #### process_filters
>
Expand Down Expand Up @@ -342,7 +342,7 @@ class FruitFilter:
)
```

> [!TIP]
> ![TIP]
> As seen above `strawberry_django.process_filters` function is exposed and can be
> reused in custom methods.
> For filter method `filter` `skip_object_order_method` was used to avoid endless recursion.
Expand Down Expand Up @@ -421,7 +421,7 @@ There is 7 already defined Generic Lookup `strawberry.input` classes importable

The previous version of filters can be enabled via [**USE_DEPRECATED_FILTERS**](settings.md#strawberry_django)

> [!WARNING]
> ![WARNING]
> If **USE_DEPRECATED_FILTERS** is not set to `True` legacy custom filtering
> methods will be _not_ be called.

Expand Down
4 changes: 2 additions & 2 deletions docs/guide/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mutation {
}
```

> [!TIP]
> ![TIP]
> If all or most of your mutations use this behaviour, you can change the
> default behaviour for `handle_django_errors` by setting
> `MUTATIONS_DEFAULT_HANDLE_ERRORS=True` in your [strawberry django settings](../settings)
Expand Down Expand Up @@ -167,7 +167,7 @@ class Mutation:

## Filtering

> [!CAUTION]
> ![CAUTION]
> This is totally discouraged as it allows for any issue with the filters
> to be able to alter your whole model collection.

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Song.objects.all().only(
)
```

> [!NOTE]
> ![NOTE]
> Even though `album__release_date` field was not selected here, it got selected
> in the prefetch query later. Since Django caches known objects, we have to select it here or
> else it would trigger extra queries latter.
Expand Down
8 changes: 4 additions & 4 deletions docs/guide/ordering.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FruitOrder:
color: ColorOrder | None
```

> [!TIP]
> ![TIP]
> In most cases order fields should have `Optional` annotations and default value `strawberry.UNSET`.
> Above `auto` annotation is wrapped in `Optional` automatically.
> `UNSET` is automatically used for fields without `field` or with `strawberry_django.order_field`.
Expand Down Expand Up @@ -73,11 +73,11 @@ class FruitOrder:
return queryset, [ordering]
```

> [!WARNING]
> ![WARNING]
> Do not use `queryset.order_by()` directly. Due to `order_by` not being chainable
> operation, changes applied this way would be overriden later.

> [!TIP] > `strawberry_django.Ordering` has convenient method `resolve` that can be used to
> ![TIP] > `strawberry_django.Ordering` has convenient method `resolve` that can be used to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (documentation): Formatting issue with the > symbol.

The > symbol should be on a new line for consistency.

> convert field's name to appropriate `F` object with correctly applied `asc()`, `desc()` method
> with `nulls_first` and `nulls_last` arguments.

Expand Down Expand Up @@ -208,7 +208,7 @@ class FruitOrder:

```

> [!TIP]
> ![TIP]
> As seen above `strawberry_django.process_order` function is exposed and can be
> reused in custom methods.
> For order method `order` `skip_object_order_method` was used to avoid endless recursion.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Available options are:
will filter the return value, removing objects that fails the check (check below for more
information regarding other possibilities).

> [!NOTE]
> ![NOTE]
> The `HasSourcePerm` and `HasRetvalPerm` require having an
> [authentication backend](https://docs.djangoproject.com/en/4.2/topics/auth/customizing/)
> which supports resolving object permissions. This lib works out of the box with
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Query:
schema = strawberry.Schema(query=Query)
```

> [!TIP]
> ![TIP]
> You must name your query class "Query" or decorate it with `@strawberry.type(name="Query")` for the single query default primary filter to work

For the single queries (like `Fruit` above), Strawberry comes with a default primary key search filter in the GraphiQL interface. The query `Fruits` gets all the objects in the Fruits by default. To query specific sets of objects a filter need to be added in the `types.py` file.
2 changes: 1 addition & 1 deletion docs/guide/relay.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Behind the scenes this extension is doing the following for you:
You can also define your own `relay.NodeID` field and your resolve, in the same way as
`some_model_conn_with_resolver` is doing. In those cases, they will not be overridden.

> [!TIP]
> ![TIP]
> If you are only working with types inheriting from `relay.Node` and `GlobalID`
> for identifying objects, you might want to set `MAP_AUTO_ID_AS_GLOBAL_ID=True`
> in your [strawberry django settings](../settings) to make sure `auto` fields gets
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ on [How to define Fields](fields.md) for that.

### Customizing the returned `QuerySet`

> [!WARNING]
> ![WARNING]
> By doing this you are modifying all automatic `QuerySet` generation for any field
> that returns this type. Ideally you will want to define your own [resolver](resolvers.md)
> instead, which gives you more control over it.
Expand Down Expand Up @@ -131,7 +131,7 @@ class Berry:
return queryset.filter(name__contains="berry")
```

> [!NOTE]
> ![NOTE]
> Another way of limiting this is by using the [PermissionExtension](permissions.md)
> provided by this lib.

Expand Down
Loading