Download the PHP package legrisch/statamic-graphql-events without Composer
On this page you can find all versions of the php package legrisch/statamic-graphql-events. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download legrisch/statamic-graphql-events
More information about legrisch/statamic-graphql-events
Files in legrisch/statamic-graphql-events
Package statamic-graphql-events
Short Description A Statamic addon that provides a fieldset and the corresponding GraphQL Queries and fields to handle recurring events with ease.
License MIT
Informations about the package statamic-graphql-events
Statamic GraphQL Events
Statamic GraphQL Events is a Statamic addon that provides a fieldset and the corresponding GraphQL Queries and fields to handle recurring events with ease.
- GraphQL queries & fields for recurring events
- Infinitely complex recurrence rules
- Easy to set up
Index
- Install
- Setup
- How to Use
- Concepts
- Queries
eventsAfter
eventsAfterNow
eventsBetween
- Fields
occurrences
occurrencesAfter
occurrencesAfterNow
occurrencesBetween
- License
Install
Setup
This addon assumes that you want to use a single collection and entries of a single blueprint as the source of your events.
- Run
php artisan vendor:publish --tag=statamic.graphql-events --force
to publish the configuration along with the provided fieldset "Dates". - Add the provided fieldset "Dates" to the blueprints of your events collection. You may translate the fields to your liking, but be sure to keep the handles.
- Edit the addon configuration:
config/statamic/graphql-events.php
. - Open the GraphiQL Editor.
- You should see three new queries:
eventsAfter
,eventsAfterNow
andeventsBetween
.
How to Use
Concepts
An event may have an arbitrary amount of recurrence rules, however there are two limitations:
- If an event is not marked as happening "all day", a start time is required.
- If an event is marked as recurring, a date which defines the end of the recurrence is required.
Queries
Fields and Queries that use dates as an input accept everything that
Carbon::parse
accepts.
All query results are sorted by the first occurrence in the given timeframe.
eventsAfter
Returns events that have occurrences after a certain date.
Example
eventsAfterNow
Returns events that have occurrences after now.
Example
eventsBetween
Returns events that have occurrences between two provided dates.
Example
Fields
Besides the queries, this addon adds fields to the GraphQL type of your entries.
occurrences
Returns the occurrences of an event starting from the first occurrence.
Example
occurrencesAfter
Returns the occurrences of an event starting from a provided date.
Example
occurrencesAfterNow
Returns the occurrences of an event starting from now.
Example
occurrencesBetween
Returns the occurrences of an event between two provided dates.
Example
License
This project is licensed under the MIT License.