
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
A framework for building GraphQL-driven Vue.js applications.
Install Vue and Relay using yarn
or npm
:
yarn add vue vue-relay
Relay Modern requires a Babel plugin to convert GraphQL to runtime artifacts:
yarn add --dev babel-plugin-relay graphql
Add "relay"
to the list of plugins your .babelrc
file:
{
"plugins": [
"relay"
]
}
Please note that the "relay" plugin should run before other plugins or presets to ensure the graphql
template literals are correctly transformed. See Babel's documentation on this topic.
Relay's ahead-of-time compilation requires the Relay Compiler, which you can install via yarn
or npm
:
yarn add --dev relay-compiler graphql
This installs the bin script relay-compiler
in your node_modules folder. It's recommended to run this from a yarn/npm
script by adding a script to your package.json
file:
"scripts": {
"relay": "relay-compiler --src ./src --schema ./schema.graphql"
}
Then, after making edits to your application files, just run the relay
script to generate new compiled artifacts:
yarn run relay
Note: relay-compiler
does not understand single-file components with a .vue
extension. You can export
graphql
template literals in .js
files, and then import
them in .vue
single-file components.
For more details, check out Relay Compiler docs.
environment
: The Relay Environmentquery
: The graphql tagged query. Note: To enable compatibility mode, relay-compiler enforces the query to be named as <FileName>Query
. Optional, if not provided, an empty props object is passed to the render callback.variables
: Object containing set of variables to pass to the GraphQL query, i.e. a mapping from variable name to value. Note: If a new set of variables is passed, the QueryRenderer will re-fetch the query.props
: Object containing data obtained from the query; the shape of this object will match the shape of the query. If this object is not defined, it means that the data is still being fetched.error
: Error will be defined if an error has occurred while fetching the query.retry
: Reload the data. It is null if query
was not provided.<!-- Example.vue -->
<template>
<query-renderer :environment="environment" :query="query" :variables="variables" v-slot="{ props, error, retry }">
<div v-if="error">{{ error.message }}</div>
<div v-else-if="props">{{ props.page.name }} is great!</div>
<div v-else>Loading</div>
</query-renderer>
</template>
<script>
import { QueryRenderer, graphql } from 'vue-relay'
export default {
name: 'example',
components: {
QueryRenderer
},
data () {
return {
environment: ..., // https://relay.dev/docs/en/relay-environment.html
query: graphql`
query ExampleQuery($pageID: ID!) {
page(id: $pageID) {
name
}
}
`,
variables: {
pageID: '110798995619330'
}
}
}
}
</script>
createFragmentContainer([component, ]fragmentSpec)
{
relay: {
environment,
},
// Additional props as specified by the fragmentSpec
}
createRefetchContainer([component, ]fragmentSpec, refetchQuery)
{
relay: {
environment,
refetch(),
},
// Additional props as specified by the fragmentSpec
}
createPaginationContainer([component, ]fragmentSpec, connectionConfig)
{
relay: {
environment,
hasMore(),
isLoading(),
loadMore(),
refetchConnection()
},
// Additional props as specified by the fragmentSpec
}
react-relay
QueryRenderer
does not take render function.
vue-relay
replaces it with scoped slots.component
as an optional argument.
component
.Other APIs are exactly same as Relay's Public APIs. Please refer to Relay's documentation.
The vue-relay-examples repository contains an implementation of TodoMVC. To try it out:
git clone https://github.com/ntkme/vue-relay-examples.git
cd vue-relay-examples/todo
npm install
npm run build
npm start
vue-relay is BSD-2-Clause licensed.
Relay is MIT licensed.
FAQs
A framework for building GraphQL-driven Vue.js applications.
The npm package vue-relay receives a total of 12 weekly downloads. As such, vue-relay popularity was classified as not popular.
We found that vue-relay 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
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.