
Security News
Python Adopts Standard Lock File Format for Reproducible Installs
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
programmatic-query
Advanced tools
Alternative Query
component for react-apollo
to make manually fired queries less painful.
See the example use case different between react-apollo
and programmatic-query
here.
Install
yarn add programmatic-query
# or
npm install programmatic-query
Usage
import { Query } from "programmatic-query";
Query
component from react-apollo
Query
PropsThe follow props are identical in use to the Query
component in react-apollo
:
skip
query
variables
onError
onCompleted
errorPolicy
fetchPolicy
Read more about these props here.
children
- function
A render prop to return a UI based on the query executed on component mount.
Configurable to allow the execution of the query to be handled by a seperate event other than the component mount.
To switch between the result only and with query handler behavior, pass a parameter name for the query handler to allow the query to be fired when the handler is invoked. Otherwise to use the default behavior, omit the second render prop argument and the query will be fired on component mount.
Query is fired immediately upon component mount with any passed configuration to the Query component:
const App = () => (
<Query
query={gql`
{
allTodos {
id
text
}
}
`}
>
{({ data, error, loading, networkStatus }) => (
<Component>
{data && data}
{error && error}
{loading && "Loading.."}
</Component>
)}
</Query>
);
See children
prop here
const App = () => (
<Query
query={gql`
{
allTodos {
id
text
}
}
`}
>
{({ data, error, loading, networkStatus }, fetchAllTodos) => (
<Component>
{data && data}
{error && error}
{loading && "Loading.."}
<Button onPress={() => fetchAllTodos()}>Fetch All Todos</Button>
</Component>
)}
</Query>
);
fetchOnMount
- boolean
Specify if the query is fired on component mount even when a query handler is passed. Useful to easily fetch data on load, and allow a refetch via the query handler.
Uses the variables
passed as the query prop as the variable
argument.
FAQs
Query component for programmatic react-apollo queries.
The npm package programmatic-query receives a total of 4 weekly downloads. As such, programmatic-query popularity was classified as not popular.
We found that programmatic-query demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.